@Test
public void shouldCloseChannelWhenEndOfStreamIsReached() throws Exception
{

    expectEndOfInputStream();
    mockery.checking(new Expectations()
    {
        {
            one(readableByteChannel).isOpen();
            will(returnValue(true));
            one(readableByteChannel).close();
            one(connectionObserver).connectionClosed();
        }
    });
    //when
    inputStreamReader.blockingStart(readableByteChannel);
}