JavaIdentifierFilter extends Filter { @Override public Object apply(Object value, Object... params) { return JAVA_KEYWORDS.contains(value) ? "_" + value : value; } JavaIdentifierFilter(); @Override Object apply(Object value, Object... params);  }
@Test public void testApply_sanitizesValueIfJavaKeyword() { Filter filter = new JavaIdentifierFilter(); assertEquals("_class", filter.apply("class")); }
@Test public void testApply_doesNotSanitizeNonJavaKeywords() { Filter filter = new JavaIdentifierFilter(); assertEquals("foobar", filter.apply("foobar")); }