Buggy code:
public class RpcTestUtils { private static final Logger logger = LoggerFactory . getLogger ( RpcTestUtils . class ) ; private static final String localhost = "localhost" ; public static void handlerSimpleAppendTest ( AvroSourceProtocol handler ) throws EventDeliveryException , FlumeException { } public static void handlerSimpleAppendTest ( AvroSourceProtocol handler , boolean enableServerCompression , boolean enableClientCompression , int compressionLevel ) throws EventDeliveryException , FlumeException { } public static void handlerBatchAppendTest ( AvroSourceProtocol handler ) throws EventDeliveryException , FlumeException { } public static void handlerBatchAppendTest ( AvroSourceProtocol handler , boolean enableServerCompression , boolean enableClientCompression , int compressionLevel ) throws EventDeliveryException , FlumeException { } public static NettyAvroRpcClient getStockLocalClient ( int port ) { } public static NettyAvroRpcClient getStockLocalClient ( int port , Properties starterProp ) { } public static Server startServer ( AvroSourceProtocol handler , int port , boolean enableCompression ) { Responder responder = new org . apache . avro . ipc . specific . SpecificResponder ( AvroSourceProtocol . class , handler ) ; Server server ; if ( enableCompression ) { <START_BUG> server = new org . apache . avro . ipc . NettyServer ( responder , new InetSocketAddress ( RpcTestUtils . localhost , port ) , new NioServerSocketChannelFactory ( Executors . newCachedThreadPool ( ) , Executors . newCachedThreadPool ( ) ) , new RpcTestUtils . CompressionChannelPipelineFactory ( ) , null ) ; <END_BUG> } else { server = new org . apache . avro . ipc . NettyServer ( responder , new InetSocketAddress ( RpcTestUtils . localhost , port ) ) ; } server . start ( ) ; RpcTestUtils . logger . info ( "Server<seq2seq4repair_space>started<seq2seq4repair_space>on<seq2seq4repair_space>hostname:<seq2seq4repair_space>{},<seq2seq4repair_space>port:<seq2seq4repair_space>{}" , new Object [ ] { RpcTestUtils . localhost , Integer . toString ( server . getPort ( ) ) } ) ; try { Thread . sleep ( 300L ) ; } catch ( InterruptedException ex ) { RpcTestUtils . logger . error ( "Thread<seq2seq4repair_space>interrupted.<seq2seq4repair_space>Exception<seq2seq4repair_space>follows." , ex ) ; Thread . currentThread ( ) . interrupt ( ) ; } return server ; } public static Server startServer ( AvroSourceProtocol handler ) { } public static Server startServer ( AvroSourceProtocol handler , int port ) { } public static void stopServer ( Server server ) { } public static class LoadBalancedAvroHandler implements AvroSourceProtocol { private int appendCount = 0 ; private int appendBatchCount = 0 ; private boolean failed = false ; public int getAppendCount ( ) { } public int getAppendBatchCount ( ) { } public boolean isFailed ( ) { } public void setFailed ( ) { } public void setOK ( ) { } @ Override public Status append ( AvroFlumeEvent event ) throws AvroRemoteException { } @ Override public Status appendBatch ( List < AvroFlumeEvent > events ) throws AvroRemoteException { } } public static class OKAvroHandler implements AvroSourceProtocol { @ Override public Status append ( AvroFlumeEvent event ) throws AvroRemoteException { } @ Override public Status appendBatch ( List < AvroFlumeEvent > events ) throws AvroRemoteException { } } public static class FailedAvroHandler implements AvroSourceProtocol { @ Override public Status append ( AvroFlumeEvent event ) throws AvroRemoteException { } @ Override public Status appendBatch ( List < AvroFlumeEvent > events ) throws AvroRemoteException { } } public static class UnknownAvroHandler implements AvroSourceProtocol { @ Override public Status append ( AvroFlumeEvent event ) throws AvroRemoteException { } @ Override public Status appendBatch ( List < AvroFlumeEvent > events ) throws AvroRemoteException { } } public static class ThrowingAvroHandler implements AvroSourceProtocol { @ Override public Status append ( AvroFlumeEvent event ) throws AvroRemoteException { } @ Override public Status appendBatch ( List < AvroFlumeEvent > events ) throws AvroRemoteException { } } private static class CompressionChannelPipelineFactory implements ChannelPipelineFactory { @ Override public ChannelPipeline getPipeline ( ) throws Exception { } } }

Fix:
server = new org . apache . avro . ipc . NettyServer ( responder , new InetSocketAddress ( RpcTestUtils . localhost , port ) , new NioServerSocketChannelFactory ( Executors . newCachedThreadPool ( ) , Executors . newCachedThreadPool ( ) , 2 ) , new RpcTestUtils . CompressionChannelPipelineFactory ( ) , null ) ;