SafeLdapFilter { public SafeLdapFilter and(SafeLdapFilter... safeLdapFilters) { if ((safeLdapFilters == null) || (safeLdapFilters.length == 0)) { return this; } StringBundler sb = new StringBundler(); List<Object> arguments = new ArrayList<>(_arguments); sb.append(StringPool.OPEN_PARENTHESIS); sb.append(StringPool.AMPERSAND); sb.append(_filterSB); for (SafeLdapFilter safeLdapFilter : safeLdapFilters) { sb.append(safeLdapFilter._filterSB); arguments.addAll(safeLdapFilter._arguments); } sb.append(StringPool.CLOSE_PARENTHESIS); return new SafeLdapFilter(sb, arguments); } protected  SafeLdapFilter(StringBundler filterSB, List<Object> arguments); SafeLdapFilter and(SafeLdapFilter... safeLdapFilters); Object[] getArguments(); String getFilterString(); SafeLdapFilter not(); SafeLdapFilter or(SafeLdapFilter... safeLdapFilters); @Override String toString();  }
@Test public void testAnd() { SafeLdapFilter safeLdapFilter = SafeLdapFilterConstraints.eq( "key1", "value1"); test( safeLdapFilter.and(SafeLdapFilterConstraints.eq("key2", "value2")), "(&(key1={0})(key2={1}))", new Object[] {"value1", "value2"}); }