### Question:
LdapQueryBuilder extends QueryBuilder<Connection, Filter> { public <T> Iterator<Collection<T>> executeRawResults(Connection connection, Class<T> returnType) { if (String.class.equals(returnType) && requestedAttributes.length != 1) { throw new IllegalArgumentException("String return type wanted but more than 1 attribute requested"); } EntryConverter<T> entryConverter = (EntryConverter<T>) converterMap.get(returnType); if (entryConverter == null) { throw new IllegalArgumentException("Cannot convert LDAP Entry objects to " + returnType.getName()); } return new EntryIterator<T>(connection, entryConverter); } @Inject  LdapQueryBuilder(LdapDataLayerConfiguration dataLayerConfiguration, LdapSearchHandler handler,
            @Named(DataLayerConstants.DATA_LAYER_DEBUG) Debug debug,
            Map<Class, EntryConverter> converterMap); Iterator<Collection<T>> executeRawResults(Connection connection, Class<T> returnType); @Override String toString(); static final ByteString EMPTY; }### Answer:
@Test public void shouldUseHandlerToPerformSearch() throws CoreTokenException, IOException { Result mockResult = mock(Result.class); given(searchHandler.performSearch(any(Connection.class), any(SearchRequest.class), any(Collection.class))).willReturn(mockResult); Iterator iterator = builder.executeRawResults(mockConnection, PartialToken.class); verifyZeroInteractions(searchHandler); iterator.next(); verify(searchHandler).performSearch(eq(mockConnection), any(SearchRequest.class), any(Collection.class)); }