@Override
    public void encode(final Event event, final OutputStream out) throws IOException {
        encodeMetricIn.increment();

        encodeMetricTime.time(() -> codec.encode(event, out));
    }
@Test
    public void encodeDelegatesCall() throws IOException {
        codec = Mockito.spy(new AbstractCodec() {
            @Override
            public void encode(final Event event, final OutputStream out) {}
        });

        final JavaCodecDelegator codecDelegator = constructCodecDelegator();

        final Event e = new org.logstash.Event();
        final OutputStream out = new ByteArrayOutputStream();

        codecDelegator.encode(e, out);

        Mockito.verify(codec, Mockito.times(1)).encode(e, out);
    }