@Test
public void shouldAllowObserveValueUpToThreeBytes() {

    CoapPacket packet = new CoapPacket(null);
    packet.headers().setObserve(0xFFFFFF);
    assertEquals(new Integer(0xFFFFFF), packet.headers().getObserve());
    //non valid
    try {
        packet.headers().setObserve(0xFFFFFF + 1);
        fail();
    } catch (IllegalArgumentException ex) {
        //as expected
    }
}