### Question:
PeerConnection implements CTPHandler { public PeerConnection(Peer peer) { this.peer = peer; } PeerConnection(Peer peer); @Override void connectionReady(CTPConnection connection); @Override void connectionClosed(CTPConnection source, Exception reason); @Override void receiveChunk(CTPConnection source, Bufferlo data); void close(); void writeBlock(PeerResource resource, PeerBlock block); @Override String toString();  }### Answer:
@Test public void testPeerConnection() { try { StringResource stringResource = new StringResource(); String path = "/stringResource"; stringResource.setValue("Hello World"); ResourceStatus status = peer.publish(stringResource, path); StringResource clone = new StringResource(); peer.subscribe(clone, "localhost", serverPort, path); waitFor(1000); assertEquals(stringResource.getValue(), clone.getValue()); stringResource.setValue("World O Hell"); waitFor(1000); assertEquals(stringResource.getValue(), clone.getValue()); status.disconnect(); waitFor(1000); } catch(Exception e) { e.printStackTrace(); fail(e.getMessage()); } }