StringList implements Iterable<String> { public HashMap<String, String> filter( Map<String, String> _in, boolean _keep_matches, ComparisonMode _mode, CaseSensitivity _case_sensitivity) { final HashMap<String, String> out = new HashMap<String, String>(); for (Map.Entry<String, String> e : _in.entrySet()) { if (this.contains(e.getKey(), _mode, _case_sensitivity)) { if (_keep_matches) out.put(e.getKey(), e.getValue()); } else if (!_keep_matches) { out.put(e.getKey(), e.getValue()); } } return out; } StringList();  StringList(String[] _itemlist); StringList addAll(String[] _itemlist); StringList addAll(String[] _itemlist, boolean _trim); StringList addAll(String _itemlist, String _separator, boolean _trim); StringList add(String _item); StringList add(String _item, boolean _trim); Iterator<String> iterator(); boolean contains(String _value); boolean contains(String _value, ComparisonMode _mode, CaseSensitivity _case_sensitivity); boolean isEmpty(); String toString(); String toString(String _sep); HashMap<String, String> filter(
      Map<String, String> _in,
      boolean _keep_matches,
      ComparisonMode _mode,
      CaseSensitivity _case_sensitivity);  }
@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"); 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")); 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")); }