static int GetDigitalRoot ( String str ) {
  if ( str . length ( ) == 1 ) {
    return str . charAt ( 0 ) - '0' ;
  }
  str = GetIndividulaDigitSum ( str , str . length ( ) ) ;
  return GetDigitalRoot ( str ) ;
}

static int GetDigitalRoot ( String str ) { if ( str . length ( ) == 1 ) { return str . charAt ( 0 ) - '0' ; } str = GetIndividulaDigitSum ( str , str . length ( ) ) ; return GetDigitalRoot ( str ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (return_statement (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (character_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier))))))