@Override
    public ObjectNode encode(OpenstackVtapNetwork network, CodecContext context) {
        checkNotNull(network, JSON_NULL_MESSAGE, "OpenstackVtapNetwork object");

        ObjectNode result = context.mapper().createObjectNode()
                .put(MODE, network.mode().toString())
                .put(NETWORK_ID, network.networkId())
                .put(SERVER_IP, network.serverIp().toString());

        return result;
    }
@Test
    public void testEncode() {
        OpenstackVtapNetwork vtapNetwork = DefaultOpenstackVtapNetwork.builder()
                .mode(MODE)
                .networkId(VNI)
                .serverIp(IpAddress.valueOf(SERVER_IP_ADDRESS))
                .build();

        ObjectNode nodeJson = vtapNetworkCodec.encode(vtapNetwork, context);
        assertThat(nodeJson, matchesVtapNetwork(vtapNetwork));
    }