@Test
public void serializeMultipleObjectInstances() throws Exception {

    // See LWM2M spec Chapter 6.3.3.2
    // GET /2
    LWM2MObjectInstance aco0 = new LWM2MObjectInstance(LWM2MID.$0, Arrays.asList(
        new LWM2MResource(LWM2MID.from(0), 0x03),                       // resource: Object ID
        new LWM2MResource(LWM2MID.from(1), 0x01),                       // resource: Object Instance ID
        new LWM2MResource(LWM2MID.from(2), Arrays.asList(               // multiple resource: ACL
            new LWM2MResourceInstance(LWM2MID.from(1), 0b11_10_0000),   // resource instance: ACL [1]
            new LWM2MResourceInstance(LWM2MID.from(2), 0b10_00_0000))   // resource instance: ACL [1]
        ),
        new LWM2MResource(LWM2MID.from(3), 0x01)                        // resource: Access Control Owner
    ));
    LWM2MObjectInstance aco1 = new LWM2MObjectInstance(LWM2MID.$1, Arrays.asList(
            new LWM2MResource(LWM2MID.from(0), 0x04),
            new LWM2MResource(LWM2MID.from(1), 0x02),
            new LWM2MResource(LWM2MID.from(2), Arrays.asList(
                new LWM2MResourceInstance(LWM2MID.from(1), 0b10_00_0000),
                new LWM2MResourceInstance(LWM2MID.from(2), 0b10_00_0000))
            ),
            new LWM2MResource(LWM2MID.from(3), 0x01)
        ));
    byte[] acoTLV = TLVSerializer.serialize(aco0, aco1);
    assertEquals(40, acoTLV.length);
}