Criteria implements Serializable { public void addFilter( Type type, String filterString, Conjunction conjunction) { if (Validator.isNull(filterString)) { return; } String typeValueFilterString = _filterStrings.get(type.getValue()); if (Validator.isNull(typeValueFilterString)) { _filterStrings.put(type.getValue(), filterString); return; } _filterStrings.put( type.getValue(), _combineFilters(typeValueFilterString, filterString, conjunction)); } Criteria(); void addCriterion(
		String key, Type type, String filterString, Conjunction conjunction); void addFilter(
		Type type, String filterString, Conjunction conjunction); Map<String, Criterion> getCriteria(); Criterion getCriterion(String key); String getFilterString(Type type); Map<String, String> getFilterStrings(); Conjunction getTypeConjunction(Type type);  }
@Test public void testAddFilter() { Criteria criteria = new Criteria(); Criteria.Type type = Criteria.Type.CONTEXT; String filterString = randomString(); Criteria.Conjunction conjunction = Criteria.Conjunction.AND; criteria.addFilter(type, filterString, conjunction); String typeFilterString = criteria.getFilterString(type); Assert.assertEquals(typeFilterString, filterString); }