@Test
public void testFilter() {

  final StringList list = new StringList(new String[] {"foo.BAR"});
  final Map<String, String> m = new HashMap<String, String>();
  m.put("foo.bar", "abc");
  m.put("john.doe", "123");
  // keep_matches = true
  final Map<String, String> o1 =
      list.filter(m, true, ComparisonMode.EQUALS, CaseSensitivity.CASE_SENSITIVE);
  assertTrue(!o1.containsKey("foo.bar"));
  assertTrue(!o1.containsKey("john.doe"));
  final Map<String, String> o3 =
      list.filter(m, true, ComparisonMode.EQUALS, CaseSensitivity.CASE_INSENSITIVE);
  assertTrue(o3.containsKey("foo.bar"));
  assertTrue(!o3.containsKey("john.doe"));
  // keep_matches = false
  final Map<String, String> o2 =
      list.filter(m, false, ComparisonMode.EQUALS, CaseSensitivity.CASE_SENSITIVE);
  assertTrue(o2.containsKey("foo.bar"));
  assertTrue(o2.containsKey("john.doe"));
  final Map<String, String> o4 =
      list.filter(m, false, ComparisonMode.EQUALS, CaseSensitivity.CASE_INSENSITIVE);
  assertTrue(!o4.containsKey("foo.bar"));
  assertTrue(o4.containsKey("john.doe"));
}