FileContent implements Comparable<FileContent> { public InputStream open() throws IOException { try { return contentSupplier.get(); } catch (final IOException ex) { throw ex; } catch (final Throwable ex) { throw new IOException(ex); } }  InputStream open(); @Override String toString(); @Override int compareTo(final FileContent o); File getFileFrom(File base);  }
@Test public void testOpen() throws IOException { final byte[] bytes = randomUUID().toString().getBytes(); final FileContent fileContent = new FileContent( randomUUID().toString(), () -> new ByteArrayInputStream(bytes)); try (InputStream in = fileContent.open()) { assertArrayEquals(bytes, from(in)); } }