static void add ( Tree t , String d ) {
  String [ ] ss = d . substring ( 1 ) . split ( "/" ) ;
  for ( String s : ss ) {
    Tree w = null ;
    for ( Tree r : t . a ) if ( r . name . equals ( s ) ) {
      w = r ;
      break ;
    }
    if ( w == null ) {
      w = new Tree ( s ) ;
      t . a . add ( w ) ;
    }
    t = w ;
  }
}

static void add ( Tree t , String d ) { String [ ] ss = d . substring ( 1 ) . split ( " / " ) ; for ( String s : ss ) { Tree w = null ; for ( Tree r : t . a ) if ( r . name . equals ( s ) ) { w = r ; break ; } if ( w == null ) { w = new Tree ( s ) ; t . a . add ( w ) ; } t = w ; } }
(method_declaration (modifiers) type: (void_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: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (string_literal))))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (null_literal))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (field_access object: (identifier) field: (identifier)) body: (if_statement condition: (parenthesized_expression (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))))))