test_class.declarator: processor
test_class.modifier: private
test_class.original_string: private ResourceDescriptionTemplateProcessor processor;
test_class.type: ResourceDescriptionTemplateProcessor
test_class.var_name: processor
test_class.file: meta/src/test/java/org/jboss/hal/meta/description/ResourceDescriptionTemplateProcessorTest.java
test_class.identifier: ResourceDescriptionTemplateProcessorTest
test_case.body: @Test
      public void hostInTheMiddle() throws Exception {
          AddressTemplate input = AddressTemplate.of("/profile=full/subsystem=undertow/server=*/host=*/location=*");
          AddressTemplate expected = AddressTemplate.of("/profile=*/subsystem=undertow/server=*/host=*/location=*");
  
          AddressTemplate result = processor.apply(input);
          assertEquals(expected, result);
      }
test_case.class_method_signature: ResourceDescriptionTemplateProcessorTest.hostInTheMiddle()
test_case.full_signature: @Test public void hostInTheMiddle()
test_case.identifier: hostInTheMiddle
test_case.invocations: of of apply assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void hostInTheMiddle()
focal_class.file: meta/src/main/java/org/jboss/hal/meta/description/ResourceDescriptionTemplateProcessor.java
focal_class.identifier: ResourceDescriptionTemplateProcessor
focal_class.interfaces: implements Function<AddressTemplate, AddressTemplate>
focal_class.class_method_signature: ResourceDescriptionTemplateProcessor.apply(AddressTemplate template)
focal_class.full_signature: @Override public AddressTemplate apply(AddressTemplate template)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (AddressTemplate template)
focal_class.return: AddressTemplate
focal_class.signature: AddressTemplate apply(AddressTemplate template)
focal_method.body: @Override
      public AddressTemplate apply(AddressTemplate template) {
          AddressTemplate modified = AddressTemplate.ROOT;
  
          if (template != null && !AddressTemplate.ROOT.equals(template)) {
              List<String[]> segments = stream(template.spliterator(), false)
                      .map(segment -> {
                          if (segment.contains("=")) {
                              return Splitter.on('=')
                                      .omitEmptyStrings()
                                      .trimResults()
                                      .limit(2)
                                      .splitToList(segment)
                                      .toArray(new String[2]);
                          }
                          return new String[]{segment, null};
                      })
                      .collect(toList());
  
              StringBuilder builder = new StringBuilder();
              SegmentProcessor.process(segments, segment -> {
                  builder.append("/").append(segment[0]);
                  if (segment[1] != null) {
                      builder.append("=").append(segment[1]);
                  }
              });
              modified = AddressTemplate.of(builder.toString());
          }
  
          return modified;
      }
focal_method.class_method_signature: ResourceDescriptionTemplateProcessor.apply(AddressTemplate template)
focal_method.full_signature: @Override public AddressTemplate apply(AddressTemplate template)
focal_method.identifier: apply
focal_method.invocations: equals collect map stream spliterator contains toArray splitToList limit trimResults omitEmptyStrings on toList process append append append append of toString
focal_method.modifiers: @Override public
focal_method.parameters: (AddressTemplate template)
focal_method.return: AddressTemplate
focal_method.signature: AddressTemplate apply(AddressTemplate template)