@Override
    public ObjectNode encode(ApplicationId appId, CodecContext context) {
        checkNotNull(appId, "ApplicationId cannot be null");

        ObjectNode result = context.mapper().createObjectNode()
                .put("id", appId.id())
                .put("name", appId.name());

        return result;
    }
@Test
    public void testApplicationIdEncode() {

        int id = 1;
        String name = "org.onosproject.foo";
        ApplicationId appId = new DefaultApplicationId(id, name);

        ObjectNode applicationIdJson = applicationIdCodec.encode(appId, context);
        assertThat(applicationIdJson, ApplicationIdJsonMatcher.matchesApplicationId(appId));
    }