### Question:
NettyTsiHandshaker { TsiPeer extractPeer() throws GeneralSecurityException { checkState(!internalHandshaker.isInProgress()); return internalHandshaker.extractPeer(); } NettyTsiHandshaker(TsiHandshaker handshaker);   }### Answer:
@Test public void extractPeer_notNull() throws GeneralSecurityException { doHandshake(); assertNotNull(serverHandshaker.extractPeer()); assertNotNull(clientHandshaker.extractPeer()); }
@Test public void extractPeer_failsBeforeHandshake() throws GeneralSecurityException { try { clientHandshaker.extractPeer(); fail("Exception expected"); } catch (IllegalStateException ex) { } }