SequenceObjectInputStream implements ObjectInputStream<T> { @Override public void close() throws IOException { do { nextStream(); } while (in != null); } SequenceObjectInputStream(Enumeration<ObjectInputStream<T>> enumeration); @Override T readNext(); @Override void close();  }
@Test public void testClose() throws Exception { subject.close(); verify(objectInputStreamMock1).close(); verify(objectInputStreamMock2).close(); }