@Test
public void create_states() {

    // prepare
    Object decodingState = new Object();
    Object encodingState = new Object();
    IoSession session = mock(IoSession.class);
    when(decoder.createDecoderState()).thenReturn(decodingState);
    when(encoder.createEncoderState()).thenReturn(encodingState);
    // run
    filter.sessionOpened(session);
    // verify
    verify(decoder).createDecoderState();
    verify(session).setAttribute(new AttributeKey<Object>(Object.class, "internal_decoder"), decodingState);
    verify(encoder).createEncoderState();
    verify(session).setAttribute(new AttributeKey<Object>(Object.class, "internal_encoder"), encodingState);
    verifyNoMoreInteractions(encoder, decoder, session);
}