public static boolean countMine ( int i , int j , int height , int width , String [ ] [ ] S ) {
  boolean result = false ;
  if ( i - 1 >= 0 && S [ i - 1 ] [ j ] . equals ( "#" ) ) {
    result = true ;
  }
  else if ( i + 1 < height && S [ i + 1 ] [ j ] . equals ( "#" ) ) {
    result = true ;
  }
  else if ( j + 1 < width && S [ i ] [ j + 1 ] . equals ( "#" ) ) {
    result = true ;
  }
  else if ( j - 1 >= 0 && S [ i ] [ j - 1 ] . equals ( "#" ) ) {
    result = true ;
  }
  else {
  }
  return result ;
}

public static boolean countMine ( int i , int j , int height , int width , String [ ] [ ] S ) { boolean result = false ; if ( i - 1 >= 0 && S [ i - 1 ] [ j ] . equals ( " # " ) ) { result = true ; } else if ( i + 1 < height && S [ i + 1 ] [ j ] . equals ( " # " ) ) { result = true ; } else if ( j + 1 < width && S [ i ] [ j + 1 ] . equals ( " # " ) ) { result = true ; } else if ( j - 1 >= 0 && S [ i ] [ j - 1 ] . equals ( " # " ) ) { result = true ; } else { } return result ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (method_invocation object: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) right: (method_invocation object: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) right: (method_invocation object: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (method_invocation object: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true)))) alternative: (block))))) (return_statement (identifier))))