@Test
public void generate_4_04_on_unknown_resources() {

    ResourceRegistry reg = new ResourceRegistry();
    CoapMessage msg = new CoapMessage(1, MessageType.CONFIRMABLE, CoapCode.GET.getCode(), 123, null,
            new CoapOption[] { new CoapOption(CoapOptionType.URI_PATH, "test".getBytes()) }, new byte[] {});
    CoapMessage resp = reg.respond(msg, null);
    assertEquals(1, resp.getVersion());
    assertEquals(CoapCode.NOT_FOUND.getCode(), resp.getCode());
    assertArrayEquals(new CoapOption[] { new CoapOption(CoapOptionType.CONTENT_FORMAT, new byte[] { 0 }) },
            resp.getOptions());
    assertArrayEquals("not found !".getBytes(), resp.getPayload());
}