@Test
public void testClose() throws Exception {

    Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
    eofstream.close();
    Assert.assertTrue(eofstream.isSelfClosed());
    Assert.assertNull(eofstream.getWrappedStream());
    Mockito.verify(inStream, Mockito.times(1)).close();
    Mockito.verify(eofwatcher).streamClosed(inStream);
    eofstream.close();
}