public static int operation ( List < Integer > values ) {
  if ( values . get ( 0 ) == values . get ( 2 ) ) {
    return 0 ;
  }
  if ( values . get ( 0 ) == values . get ( 1 ) ) {
    int result = values . get ( 2 ) - values . get ( 1 ) ;
    values . set ( 0 , values . get ( 2 ) ) ;
    values . set ( 1 , values . get ( 2 ) ) ;
    return result ;
  }
  if ( ( values . get ( 1 ) - values . get ( 0 ) ) % 2 == 0 ) {
    int result = ( values . get ( 1 ) - values . get ( 0 ) ) / 2 ;
    values . set ( 0 , values . get ( 1 ) ) ;
    return result ;
  }
  else {
    int result = ( values . get ( 1 ) + 1 - values . get ( 0 ) ) / 2 ;
    values . set ( 0 , values . get ( 1 ) ) ;
    values . set ( 1 , values . get ( 1 ) + 1 ) ;
    return result ;
  }
}

public static int operation ( List < Integer > values ) { if ( values . get ( 0 ) == values . get ( 2 ) ) { return 0 ; } if ( values . get ( 0 ) == values . get ( 1 ) ) { int result = values . get ( 2 ) - values . get ( 1 ) ; values . set ( 0 , values . get ( 2 ) ) ; values . set ( 1 , values . get ( 2 ) ) ; return result ; } if ( ( values . get ( 1 ) - values . get ( 0 ) ) % 2 == 0 ) { int result = ( values . get ( 1 ) - values . get ( 0 ) ) / 2 ; values . set ( 0 , values . get ( 1 ) ) ; return result ; } else { int result = ( values . get ( 1 ) + 1 - values . get ( 0 ) ) / 2 ; values . set ( 0 , values . get ( 1 ) ) ; values . set ( 1 , values . get ( 1 ) + 1 ) ; return result ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) consequence: (block (return_statement (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) right: (decimal_integer_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (return_statement (identifier))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) right: (decimal_integer_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (decimal_integer_literal))))) (return_statement (identifier))))))