public void xxtestDelayedAsynchWrite() throws Exception {
        mockSelect.setDefaultReturnValue("getThread", Thread.currentThread());
        MySelectableChannel channel = new MySelectableChannel((SocketChannel)mockSunsChannel);
        MyKey key = new MyKey(channel);
        mockSunsChannel.setDefaultReturnValue("getSelectableChannel", channel);
        MockObject mockKey = key.getMock();
        mockKey.addIgnore("readyOps");
        mockKey.setDefaultReturnValue("channel", mockSunsChannel);
        mockKey.setDefaultReturnValue("readyOps", SelectionKey.OP_WRITE);
        
        //mockSunsChannel.setDefaultBehavior("write", new CloneForDelayedWrite());

        String expected = "abc";
        String expected2 = "def";
        int remain2 = fireSelector(key, expected, expected2, true);
        
        String[] methodsNames = new String[] { "write", "write" };
        CalledMethod[] methods = mockSunsChannel.expect(methodsNames);
        
        ByteBuffer actual = (ByteBuffer)methods[0].getAllParams()[0];        
        String msg = HELPER.readString(actual, actual.remaining());
        assertEquals(expected, msg);
        
        //because cache1 was a snapshot of what was passed in, we need to modify it...
        ByteBuffer cache1 = (ByteBuffer)methods[1].getAllParams()[0];
        cache1.limit(1);
        
        ByteBuffer b3 = ByteBuffer.allocate(50);
        int remain3 = b3.remaining();
        String expected3 = "ghi";
        HELPER.putString(b3, expected3);
        HELPER.doneFillingBuffer(b3);
        client1.oldWrite(b3, (OperationCallback)mockWriteHandler);        

        Set<SelectionKey> set = new HashSet<SelectionKey>();
        set.add(key);
        mockSelect.addReturnValue("select", 1);
        mockSelect.addReturnValue("selectedKeys", set);
        //mockKey.addReturnValue("interestOps", SelectionKey.OP_WRITE);        
        
        mockSunsChannel.addBehavior("write", new NoReadByteBuffer2(remain2));
        mockSunsChannel.addBehavior("write", new NoReadByteBuffer2(remain3));
        mockKey.addReturnValue("interestOps", SelectionKey.OP_WRITE);
        //fire the selector again....
        listener.selectorFired();
        
        methods = mockSunsChannel.expect(methodsNames);
        
        ByteBuffer cache2 = (ByteBuffer)methods[0].getAllParams()[0];
        ByteBuffer actual2 = ByteBuffer.allocate(20);
        actual2.put(cache1);
        actual2.put(cache2);
        HELPER.doneFillingBuffer(actual2);
        String msg2 = HELPER.readString(actual2, actual2.remaining());
        assertEquals(expected2, msg2);
        
        ByteBuffer actual3 = (ByteBuffer)methods[1].getAllParams()[0];
        String msg3 = HELPER.readString(actual3, actual3.remaining());
        assertEquals(expected3, msg3);
        
        //expect that an unregistration happened
        String[] methodNames = new String[] { "interestOps", "interestOps" };
        methods = mockKey.expect(methodNames);
        
        //expect that this channel is no longer interested in anything
        int ops = (Integer)methods[1].getAllParams()[0];
        assertEquals(0, ops);
        
        //make sure data can flow through as usual...
        runBasic();
    }