Program: 4168
Project: 4168
Buggy source:
public void testShutdownCancelsInitialize() throws Exception {
  Executor executor=ExecutorsHelper.newProcessingQueue("String_Node_Str");
  SSLContext context=SSLContext.getInstance("String_Node_Str");
  context.init(null,null,null);
  final SSLReadWriteChannel channel1=new SSLReadWriteChannel(context,executor);
  final SSLReadWriteChannel channel2=new SSLReadWriteChannel(context,executor);
  ByteBufferCache cache=NIODispatcher.instance().getBufferCache();
  cache.clearCache();
  channel1.shutdown();
  SSLSession session1=NIODispatcher.instance().getScheduledExecutorService().submit(new Callable<SSLSession>(){
    public SSLSession call(){
      channel1.initialize(null,new String[]{"String_Node_Str"},true,false);
      return channel1.getSession();
    }
  }
).get();
  assertNull(session1);
  assertEquals(0,cache.getHeapCacheSize());
  cache.clearCache();
  SSLSession session2=NIODispatcher.instance().getScheduledExecutorService().submit(new Callable<SSLSession>(){
    public SSLSession call(){
      channel2.initialize(null,new String[]{"String_Node_Str"},true,false);
      return channel2.getSession();
    }
  }
).get();
  assertNotNull(session2);
  assertEquals(0,cache.getHeapCacheSize());
  channel2.shutdown();
  NIODispatcher.instance().getScheduledExecutorService().submit(new Runnable(){
    public void run(){
    }
  }
).get();
  assertNotEquals(0,cache.getHeapCacheSize());
  assertEquals(session2.getApplicationBufferSize() + session2.getPacketBufferSize(),cache.getHeapCacheSize());
}

Fixed version (ground truth):
public void testShutdownCancelsInitialize() throws Exception {
  Executor executor=ExecutorsHelper.newProcessingQueue("String_Node_Str");
  SSLContext context=SSLContext.getInstance("String_Node_Str");
  context.init(null,null,null);
  final SSLReadWriteChannel channel1=new SSLReadWriteChannel(context,executor,NIODispatcher.instance().getBufferCache(),NIODispatcher.instance().getScheduledExecutorService());
  final SSLReadWriteChannel channel2=new SSLReadWriteChannel(context,executor,NIODispatcher.instance().getBufferCache(),NIODispatcher.instance().getScheduledExecutorService());
  ByteBufferCache cache=NIODispatcher.instance().getBufferCache();
  cache.clearCache();
  channel1.shutdown();
  SSLSession session1=NIODispatcher.instance().getScheduledExecutorService().submit(new Callable<SSLSession>(){
    public SSLSession call(){
      channel1.initialize(null,new String[]{"String_Node_Str"},true,false);
      return channel1.getSession();
    }
  }
).get();
  assertNull(session1);
  assertEquals(0,cache.getHeapCacheSize());
  cache.clearCache();
  SSLSession session2=NIODispatcher.instance().getScheduledExecutorService().submit(new Callable<SSLSession>(){
    public SSLSession call(){
      channel2.initialize(null,new String[]{"String_Node_Str"},true,false);
      return channel2.getSession();
    }
  }
).get();
  assertNotNull(session2);
  assertEquals(0,cache.getHeapCacheSize());
  channel2.shutdown();
  NIODispatcher.instance().getScheduledExecutorService().submit(new Runnable(){
    public void run(){
    }
  }
).get();
  assertNotEquals(0,cache.getHeapCacheSize());
  assertEquals(session2.getApplicationBufferSize() + session2.getPacketBufferSize(),cache.getHeapCacheSize());
}