@Override
    public ObjectNode encode(FilteredConnectPoint entity,
                             CodecContext context) {
        ObjectNode node = context.mapper().createObjectNode();
        node.set(CONNECT_POINT, context.encode(entity.connectPoint(), ConnectPoint.class));
        node.set(TRAFFIC_SELECTOR, context.encode(entity.trafficSelector(), TrafficSelector.class));
        return node;
    }
@Test
    public void testJsonFormat() throws JsonProcessingException, IOException {
        FilteredConnectPoint original = new FilteredConnectPoint(CP, VLAN_SELECTOR);

        // Jackson configuration for ease of Numeric node comparison
        // - treat integral number node as long node
        context.mapper().enable(DeserializationFeature.USE_LONG_FOR_INTS);
        context.mapper().setNodeFactory(new JsonNodeFactory(false) {
            @Override
            public NumericNode numberNode(int v) {
                return super.numberNode((long) v);
            }
            @Override
            public NumericNode numberNode(short v) {
                return super.numberNode((long) v);
            }
        });

        ObjectNode json = sut.encode(original, context);
        JsonNode expected = context.mapper().readTree(JSON);

        assertEquals(expected, json);
    }