static boolean isBinary ( int number ) {
  Set < Integer > set = new HashSet < > ( ) ;
  while ( number > 0 ) {
    int digit = number % 10 ;
    set . add ( digit ) ;
    number /= 10 ;
  }
  set . remove ( 0 ) ;
  set . remove ( 1 ) ;
  if ( set . size ( ) == 0 ) {
    return true ;
  }
  return false ;
}

static boolean isBinary ( int number ) { Set < Integer > set = new HashSet < > ( ) ; while ( number > 0 ) { int digit = number % 10 ; set . add ( digit ) ; number /= 10 ; } set . remove ( 0 ) ; set . remove ( 1 ) ; if ( set . size ( ) == 0 ) { return true ; } return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (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)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (return_statement (true)))) (return_statement (false))))