public static int cost ( int i , int j ) {
  int result ;
  if ( j > g + b ) {
    result = Math . abs ( i - 400 ) ;
  }
  else if ( j > b ) {
    result = Math . abs ( i - 500 ) ;
  }
  else {
    result = Math . abs ( i - 600 ) ;
  }
  return result ;
}

public static int cost ( int i , int j ) { int result ; if ( j > g + b ) { result = Math . abs ( i - 400 ) ; } else if ( j > b ) { result = Math . abs ( i - 500 ) ; } else { result = Math . abs ( i - 600 ) ; } return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (return_statement (identifier))))