CollectingNameClassPairCallbackHandler implements
        NameClassPairCallbackHandler { public final void handleNameClassPair(NameClassPair nameClassPair) throws NamingException { list.add(getObjectFromNameClassPair(nameClassPair)); }  List<T> getList(); final void handleNameClassPair(NameClassPair nameClassPair); abstract T getObjectFromNameClassPair(
            NameClassPair nameClassPair);  }
@Test public void testHandleNameClassPair() throws NamingException { tested.handleNameClassPair(expectedNameClassPair); List result = tested.getList(); assertThat(result).hasSize(1); assertThat(result.get(0)).isSameAs(expectedResult); }