@Test
public void test_findMatchForSeparateResponse() throws Exception {

    CoapPacket request = newCoapPacket(REMOTE_ADR).mid(1).con().get().token(123).uriPath("/test").build();
    CoapPacket requestInactive = newCoapPacket(REMOTE_ADR).mid(2).con().get().token(456).uriPath("/test").build();
    // active
    CoapTransaction activeTrans = new CoapTransaction(mock(RequestCallback.class), request, mock(CoapUdpMessaging.class), TransportContext.NULL, mock(Consumer.class)).makeActiveForTests();
    assertTrue(transMgr.addTransactionAndGetReadyToSend(activeTrans));
    CoapTransaction inactiveTrans = new CoapTransaction(mock(RequestCallback.class), requestInactive, mock(CoapUdpMessaging.class), TransportContext.NULL, mock(Consumer.class));
    assertFalse(transMgr.addTransactionAndGetReadyToSend(inactiveTrans));
    // active match
    assertMatch(newCoapPacket(REMOTE_ADR).mid(12).con(Code.C205_CONTENT).token(123).build(), activeTrans);
    assertNoMatch(newCoapPacket(REMOTE_ADR).mid(12).non(Code.C205_CONTENT).token(123).build());
    // inactive match
    assertNoMatch(newCoapPacket(REMOTE_ADR).mid(13).con(Code.C205_CONTENT).token(456).build());
    //failures
    //message type: ACK
    assertNoMatch(newCoapPacket(REMOTE_ADR).mid(12).ack(Code.C205_CONTENT).token(123).build());
    //wrong token
    assertNoMatch(newCoapPacket(REMOTE_ADR).mid(12).con(Code.C205_CONTENT).token(12).build());
    //wrong address
    assertNoMatch(newCoapPacket(InMemoryCoapTransport.createAddress(61616)).mid(12).con(Code.C205_CONTENT).token(123).build());
    //another request
    assertNoMatch(newCoapPacket(REMOTE_ADR).mid(12).con().get().token(123).build());
}