### Question:
AbstractPeerConnection implements PeerConnection { @Override public void send(final Capability capability, final MessageData message) throws PeerNotConnected { if (isDisconnected()) { throw new PeerNotConnected("Attempt to send message to a closed peer connection"); } doSend(capability, message); } protected  AbstractPeerConnection(
      final Peer peer,
      final PeerInfo peerInfo,
      final InetSocketAddress localAddress,
      final InetSocketAddress remoteAddress,
      final String connectionId,
      final CapabilityMultiplexer multiplexer,
      final PeerConnectionEventDispatcher connectionEventDispatcher,
      final LabelledMetric<Counter> outboundMessagesCounter); @Override void send(final Capability capability, final MessageData message); @Override PeerInfo getPeerInfo(); @Override Capability capability(final String protocol); @Override Peer getPeer(); @Override Set<Capability> getAgreedCapabilities(); @Override void terminateConnection(final DisconnectReason reason, final boolean peerInitiated); @Override void disconnect(final DisconnectReason reason); @Override boolean isDisconnected(); @Override InetSocketAddress getLocalAddress(); @Override InetSocketAddress getRemoteAddress(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void send_successful() throws PeerNotConnected { connection.send(null, PingMessage.get()); assertThat(connection.sentMessages.size()).isEqualTo(1); assertThat(connection.sentMessages).contains(new SentMessage(null, PingMessage.get())); }