### Question:
AmbariLdapDataPopulator { protected Filter createCustomMemberFilter(String memberAttributeValue, String syncMemberFilter) { Filter filter = null; if (StringUtils.isNotEmpty(syncMemberFilter)) { filter = new HardcodedFilter(syncMemberFilter.replace(MEMBER_ATTRIBUTE_VALUE_PLACEHOLDER, memberAttributeValue)); } return filter; } @Inject  AmbariLdapDataPopulator(Provider<AmbariLdapConfiguration> configurationProvider, Users users); boolean isLdapEnabled(); LdapSyncDto getLdapSyncInfo(); LdapBatchDto synchronizeAllLdapGroups(LdapBatchDto batchInfo); LdapBatchDto synchronizeAllLdapUsers(LdapBatchDto batchInfo); LdapBatchDto synchronizeLdapGroups(Set<String> groups, LdapBatchDto batchInfo); LdapBatchDto synchronizeLdapUsers(Set<String> users, LdapBatchDto batchInfo); LdapBatchDto synchronizeExistingLdapGroups(LdapBatchDto batchInfo); LdapBatchDto synchronizeExistingLdapUsers(LdapBatchDto batchInfo);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testCreateCustomMemberFilter() { final Provider<AmbariLdapConfiguration> configurationProvider = createNiceMock(Provider.class); AmbariLdapConfiguration configuration = createNiceMock(AmbariLdapConfiguration.class); expect(configurationProvider.get()).andReturn(configuration).anyTimes(); Users users = createNiceMock(Users.class); replay(configurationProvider, configuration); AmbariLdapDataPopulatorTestInstance populator = new AmbariLdapDataPopulatorTestInstance(configurationProvider, users); Filter result = populator.createCustomMemberFilter("myUid", "(&(objectclass=posixaccount)(uid={member}))"); assertEquals("(&(objectclass=posixaccount)(uid=myUid))", result.encode()); }