@Test
public void testGetPeerAuthenticatorInstances_singleton() throws Exception {

  when(config.getPeerAuthenticators()).thenReturn(ImmutableList.of(PassPeerAuthenticator.class,
      FailPeerAuthenticator.class, PassPeerAuthenticator.class));
  List<PeerAuthenticator> peerAuthenticators =
      Lists.newArrayList(peerAuth.getPeerAuthenticatorInstances());
  assertEquals(3, peerAuthenticators.size());
  assertTrue(peerAuthenticators.get(0) instanceof PassPeerAuthenticator);
  assertTrue(peerAuthenticators.get(1) instanceof FailPeerAuthenticator);
  assertTrue(peerAuthenticators.get(2) instanceof PassPeerAuthenticator);
  assertSame(peerAuthenticators.get(0), peerAuthenticators.get(2));
}