### Question:
FilterUtils { public static boolean filterString(Filter filter, String value) { FilterOperator operator = getFilterOperator(filter); if (value == null) { return false; } boolean result = false; for (String filterValue : getFilterValues(filter)) { switch (operator) { case EQUAL: result |= value.equals(filterValue); break; case NOT_EQUAL: result |= !value.equals(filterValue); break; case LIKE: result |= value.toLowerCase().contains(filterValue.toLowerCase()); break; case GREATER: result |= value.compareTo(filterValue) >= 0; break; case LOWER: result |= value.compareTo(filterValue) <= 0; break; default: throw new UnsupportedOperationException(getUnsupportedOperatorMessage(filter)); } } return result; } private  FilterUtils(); static TransformingComparator createCaseInsensitiveComparator(); static boolean filterString(Filter filter, String value); static boolean filterBoolean(Filter filter, boolean value); static boolean filterInt(Filter filter, Integer value); static boolean filterLong(Filter filter, Long value); static boolean filterDate(Filter filter, Date value); static boolean filterDouble(Filter filter, double value);  }### Answer:
@Test public void shouldFilterStrings() { assertTrue(filterString("a", FilterOperator.EQUAL, new String[]{"a", "b"})); assertFalse(filterString("a", FilterOperator.EQUAL, new String[]{"A", "B"})); assertTrue(filterString("a", FilterOperator.NOT_EQUAL, new String[]{"b", "c"})); assertFalse(filterString("a", FilterOperator.NOT_EQUAL, "a")); assertTrue(filterString("-A-", FilterOperator.LIKE, new String[]{"a", "b"})); assertFalse(filterString("-A-", FilterOperator.LIKE, new String[]{"b", "c"})); assertTrue(filterString("c", FilterOperator.GREATER, new String[]{"a", "b"})); assertFalse(filterString("a", FilterOperator.GREATER, new String[]{"b", "c"})); assertTrue(filterString("a", FilterOperator.LOWER, new String[]{"b", "c"})); assertFalse(filterString("c", FilterOperator.LOWER, new String[]{"a", "b"})); }