test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/base/normalizer/RootTermDistanceCalculatorTest.java
test_class.identifier: RootTermDistanceCalculatorTest
test_case.body: @Test
      public void calculateMinimalDistanceReturnsZeroWhenTermEqualsDerivedTerm() {
          // given
          var rootTerm = "banana";
          var derivedTerm = "yellow-thing";
          var term = derivedTerm;
  
          var calculator = new RootTermDistanceCalculator(rootTerm, Set.of(derivedTerm));
  
          // when
          var actualMinDistance = calculator.calculateMinimalDistance(term);
  
          // then
          assertThat(actualMinDistance).isEqualTo(0);
      }
test_case.class_method_signature: RootTermDistanceCalculatorTest.calculateMinimalDistanceReturnsZeroWhenTermEqualsDerivedTerm()
test_case.full_signature: @Test public void calculateMinimalDistanceReturnsZeroWhenTermEqualsDerivedTerm()
test_case.identifier: calculateMinimalDistanceReturnsZeroWhenTermEqualsDerivedTerm
test_case.invocations: of calculateMinimalDistance isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void calculateMinimalDistanceReturnsZeroWhenTermEqualsDerivedTerm()
focal_class.declarator: originalRootTerm
focal_class.modifier: private final
focal_class.original_string: private final String originalRootTerm;
focal_class.type: String
focal_class.var_name: originalRootTerm
focal_class.declarator: lowerCaseRootTerm
focal_class.modifier: private final
focal_class.original_string: private final String lowerCaseRootTerm;
focal_class.type: String
focal_class.var_name: lowerCaseRootTerm
focal_class.declarator: derivedTerms
focal_class.modifier: private final
focal_class.original_string: private final Set<String> derivedTerms;
focal_class.type: Set<String>
focal_class.var_name: derivedTerms
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/base/normalizer/RootTermDistanceCalculator.java
focal_class.identifier: RootTermDistanceCalculator
focal_class.class_method_signature: RootTermDistanceCalculator.RootTermDistanceCalculator(String rootTerm, Set<String> derivedTerms)
focal_class.full_signature: public  RootTermDistanceCalculator(String rootTerm, Set<String> derivedTerms)
focal_class.identifier: RootTermDistanceCalculator
focal_class.modifiers: public
focal_class.parameters: (String rootTerm, Set<String> derivedTerms)
focal_class.signature:  RootTermDistanceCalculator(String rootTerm, Set<String> derivedTerms)
focal_class.class_method_signature: RootTermDistanceCalculator.calculateMinimalDistance(String stringToMatch)
focal_class.full_signature: public int calculateMinimalDistance(String stringToMatch)
focal_class.identifier: calculateMinimalDistance
focal_class.modifiers: public
focal_class.parameters: (String stringToMatch)
focal_class.return: int
focal_class.signature: int calculateMinimalDistance(String stringToMatch)
focal_class.class_method_signature: RootTermDistanceCalculator.nearestRootTerm(Set<RootTermDistanceCalculator> distanceCalculators, String term, int threshold)
focal_class.full_signature: public static String nearestRootTerm(Set<RootTermDistanceCalculator> distanceCalculators, String term, int threshold)
focal_class.identifier: nearestRootTerm
focal_class.modifiers: public static
focal_class.parameters: (Set<RootTermDistanceCalculator> distanceCalculators, String term, int threshold)
focal_class.return: String
focal_class.signature: String nearestRootTerm(Set<RootTermDistanceCalculator> distanceCalculators, String term, int threshold)
focal_class.class_method_signature: RootTermDistanceCalculator.calculateLevenshteinDistance(String firstString, String secondString)
focal_class.full_signature: private int calculateLevenshteinDistance(String firstString, String secondString)
focal_class.identifier: calculateLevenshteinDistance
focal_class.modifiers: private
focal_class.parameters: (String firstString, String secondString)
focal_class.return: int
focal_class.signature: int calculateLevenshteinDistance(String firstString, String secondString)
focal_class.class_method_signature: RootTermDistanceCalculator.mergeRootTermAndDerivedTerms()
focal_class.full_signature: private Set<String> mergeRootTermAndDerivedTerms()
focal_class.identifier: mergeRootTermAndDerivedTerms
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> mergeRootTermAndDerivedTerms()
focal_method.body: public int calculateMinimalDistance(String stringToMatch) {
          var lowerCaseStringToMatch = stringToMatch.toLowerCase();
          var mergedSet = mergeRootTermAndDerivedTerms();
          boolean matchesRootTermOrDerivedTerm = mergedSet.contains(lowerCaseStringToMatch);
  
          if(matchesRootTermOrDerivedTerm) {
              return 0;
          }
  
          return mergedSet.parallelStream()
                  .mapToInt(term -> calculateLevenshteinDistance(term, lowerCaseStringToMatch))
                  .min()
                  .orElse(0);
      }
focal_method.class_method_signature: RootTermDistanceCalculator.calculateMinimalDistance(String stringToMatch)
focal_method.full_signature: public int calculateMinimalDistance(String stringToMatch)
focal_method.identifier: calculateMinimalDistance
focal_method.invocations: toLowerCase mergeRootTermAndDerivedTerms contains orElse min mapToInt parallelStream calculateLevenshteinDistance
focal_method.modifiers: public
focal_method.parameters: (String stringToMatch)
focal_method.return: int
focal_method.signature: int calculateMinimalDistance(String stringToMatch)