private static boolean hasNeighbor ( int h , int w ) {
  return ( h != 0 && "#" . equals ( s [ h - 1 ] [ w ] ) ) || ( h != s . length - 1 && "#" . equals ( s [ h + 1 ] [ w ] ) ) || ( w != 0 && "#" . equals ( s [ h ] [ w - 1 ] ) ) || ( w != s [ h ] . length - 1 && "#" . equals ( s [ h ] [ w + 1 ] ) ) ;
}

private static boolean hasNeighbor ( int h , int w ) { return ( h != 0 && " # " . equals ( s [ h - 1 ] [ w ] ) ) || ( h != s . length - 1 && " # " . equals ( s [ h + 1 ] [ w ] ) ) || ( w != 0 && " # " . equals ( s [ h ] [ w - 1 ] ) ) || ( w != s [ h ] . length - 1 && " # " . equals ( s [ h ] [ w + 1 ] ) ) ; }
(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))) body: (block (return_statement (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)))))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) right: (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier))))))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (array_access array: (identifier) index: (identifier)) field: (identifier)) right: (decimal_integer_literal))) right: (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))))