AbstractSubscribe extends AbstractRedisCommand<Object> implements Subscribe { @Override protected Object doReceiveResponse(Channel channel, ByteBuf byteBuf) throws Exception { if(!hasDataRead(byteBuf)){ return null; } Object response = super.doReceiveResponse(channel, byteBuf); if (response == null) { return null; } return processResponse(channel, response); } protected  AbstractSubscribe(String host, int port, ScheduledExecutorService scheduled,
                                Subscribe.MESSAGE_TYPE messageType, String... subscribeChannel);  AbstractSubscribe(String host, int port, ScheduledExecutorService scheduled, int commandTimeoutMilli,
                             MESSAGE_TYPE messageType, String... subscribeChannel);  AbstractSubscribe(SimpleObjectPool<NettyClient> clientPool, ScheduledExecutorService scheduled,
                             MESSAGE_TYPE messageType, String... subscribeChannel); @Override void addChannelListener(SubscribeListener listener); @Override void removeChannelListener(SubscribeListener listener); @Override ByteBuf getRequest(); @Override void unSubscribe();  }
@Test public void testSubscribeWithEmptyByteBuf() throws Exception { Assert.assertNull(subscribe.doReceiveResponse(new EmbeddedChannel(), Unpooled.buffer())); }