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