public static boolean checkOccurrenceTwoSubstring ( String str , String first , String second ) {
  boolean check = true ;
  int firstIndex = str . indexOf ( first ) ;
  if ( firstIndex >= 0 ) {
    int secondIndex = str . substring ( firstIndex + first . length ( ) ) . indexOf ( second ) ;
    if ( secondIndex < 0 ) {
      check = false ;
    }
  }
  else {
    check = false ;
  }
  return check ;
}

public static boolean checkOccurrenceTwoSubstring ( String str , String first , String second ) { boolean check = true ; int firstIndex = str . indexOf ( first ) ; if ( firstIndex >= 0 ) { int secondIndex = str . substring ( firstIndex + first . length ( ) ) . indexOf ( second ) ; if ( secondIndex < 0 ) { check = false ; } } else { check = false ; } return check ; }
(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)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false)))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (false))))) (return_statement (identifier))))