### Question:
UnitNormalizer { public static String detectUnit(String text) { for (String unit : ALL_UNITS) { if (PATTERNS.get(unit).matcher(text).find()) { return unit; } } return null; }  static String detectUnit(String text); static String detectUnit(String text, UnitType unitType); static Collection<String> getAllUnitsOfSameType(String unit); static boolean isBigger(String unitB, String unitS); static boolean unitsSameType(String unit1, String unit2); static String findBaseUnit(String unit); static double unitLookup(String unit); static double handleSpecialFormat(double number, String unitText, int decimals); static double transorm(String unitTo, double value); static double transorm(String unitTo, String value); static UnitType getUnitType(String string); static double getNormalizedNumber(String unitText); static double getNormalizedNumber(double number, String unitText); static double getNormalizedNumber(double number, String unitText, int decimals, String combinedSearchPreviousUnit); static Pair<Double, List<String>> smartTransform(Double normalizedValue, UnitType unitType); static void main(String[] args);  }### Answer:
@Test public void testDetectUnit() { String input; input = "10 t"; collector.checkThat(UnitNormalizer.detectUnit(input), Matchers.is("t")); input = "120 g/cm³"; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.DENSITY)); input = "120 gr."; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.WEIGHT)); input = "bis zu 230mb/s"; collector.checkThat(UnitNormalizer.detectUnit(input), Matchers.is("MB/s")); input = "230 MB/s"; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.BANDWIDTH)); input = "1 mAh"; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.ELECTRIC_CHARGE)); input = "1 A"; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.CURRENT)); input = "100 kN/m^2"; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.PRESSURE)); input = "100 kN/m²"; collector.checkThat(UnitNormalizer.getUnitType(input), Matchers.is(UnitType.PRESSURE)); input = "100kN/m²"; collector.checkThat(UnitNormalizer.detectUnit(input), Matchers.is("kN/m²")); input = "230 Volt"; collector.checkThat(UnitNormalizer.detectUnit(input), Matchers.is("Volt")); input = "39 hours"; collector.checkThat(UnitNormalizer.detectUnit(input), Matchers.is("hours")); input = "filter_groess # filter_groess # gross # 39"; collector.checkThat(UnitNormalizer.detectUnit(input), Matchers.nullValue()); }