public static boolean check ( String s , String str ) {
  char [ ] chars = s . toCharArray ( ) ;
  for ( char c : chars ) {
    if ( ! str . contains ( String . valueOf ( c ) ) ) {
      return false ;
    }
  }
  for ( int i = 0 ;
  i < chars . length - 1 ;
  i ++ ) {
    if ( chars [ i ] == chars [ i + 1 ] ) {
      return false ;
    }
  }
  return true ;
}

public static boolean check ( String s , String str ) { char [ ] chars = s . toCharArray ( ) ; for ( char c : chars ) { if ( ! str . contains ( String . valueOf ( c ) ) ) { return false ; } } for ( int i = 0 ; i < chars . length - 1 ; i ++ ) { if ( chars [ i ] == chars [ i + 1 ] ) { return false ; } } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) consequence: (block (return_statement (false)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (return_statement (false)))))) (return_statement (true))))