@Test( expected = PeerException.class )
public void testSendRequestInternal() throws Exception
{

    localPeer.sendRequestInternal( REQUEST, RECIPIENT, Object.class );
    verify( requestListener ).onRequest( any( Payload.class ) );
    Map<String, String> headers = Maps.newHashMap();
    localPeer.sendRequest( REQUEST, RECIPIENT, 1, headers );
    verify( requestListener, times( 2 ) ).onRequest( any( Payload.class ) );
    localPeer.sendRequest( REQUEST, RECIPIENT, 1, Object.class, 1, headers );
    verify( requestListener, times( 3 ) ).onRequest( any( Payload.class ) );
    doThrow( new RuntimeException() ).when( requestListener ).onRequest( any( Payload.class ) );
    localPeer.sendRequestInternal( REQUEST, RECIPIENT, Object.class );
}