### Question:
DevicePrintComparator { public ComparisonResult compareUserAgent(String currentValue, String storedValue, long penaltyPoints, boolean ignoreVersion) { if (ignoreVersion) { currentValue = currentValue.replaceAll("[[0-9]\\.]+", "").trim(); storedValue = storedValue.replaceAll("[[0-9]\\.]+", "").trim(); } return compare(currentValue, storedValue, penaltyPoints); } DevicePrintComparator(MultiValueAttributeComparator multiValueAttributeComparator,
            ColocationComparator colocationComparator); ComparisonResult compare(DevicePrint currentDevicePrint, DevicePrint storedDevicePrint,
            DevicePrintAuthenticationConfig config); ComparisonResult compare(String currentValue, String storedValue, long penaltyPoints); ComparisonResult compareUserAgent(String currentValue, String storedValue, long penaltyPoints,
            boolean ignoreVersion); ComparisonResult compare(String currentValue, String storedValue, int maxDifferences,
            int maxDifferencesPercentage, long penaltyPoints); ComparisonResult compare(Double currentLatitude, Double currentLongitude, Double storedLatitude,
            Double storedLongitude, long maxToleratedDistance, long penaltyPoints); ComparisonResult compareScreenResolution(String currentWidth, String currentHeight, String storedWidth,
            String storedHeight, long penaltyPoints);  }### Answer:
@Test public void shouldCompareUserAgentsIgnoringVersionNumbers() { ComparisonResult comparisonResult = devicePrintComparator.compareUserAgent("USER_AGENT_1234567890.", "1234USER_.567890AGENT_", 10L, true); assertEquals((long) comparisonResult.getPenaltyPoints(), 0L); assertFalse(comparisonResult.getAdditionalInfoInCurrentValue()); }