extracts netty code from test to separate class