static int maxOfRightElement ( Node root ) {
  int res = Integer . MIN_VALUE ;
  if ( root == null ) return - 1 ;
  if ( root . right != null ) res = root . right . data ;
  return Math . max ( maxOfRightElement ( root . right ) , Math . max ( res , maxOfRightElement ( root . left ) ) ) ;
}

static int maxOfRightElement ( Node root ) { int res = Integer . MIN_VALUE ; if ( root == null ) return - 1 ; if ( root . right != null ) res = root . right . data ; return Math . max ( maxOfRightElement ( root . right ) , Math . max ( res , maxOfRightElement ( root . left ) ) ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (null_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))))))