@Test
public void serializeOpaqueResource() throws Exception {

    byte[] opaque = new byte[]{1,2,3,4};
    LWM2MResource resource = new LWM2MResource(LWM2MID.$0, opaque);
    String json = serializer.serialize(resource);
    System.out.println(Base64.getEncoder().encodeToString(opaque));
    System.out.println(json);
    assertThat (json, equalTo("{\"e\":[{\"n\":\"0\",\"sv\":\"AQIDBA==\"}]}"));
}