File extends Resource { public BufferedReader open() throws IOException { try { return new BufferedReader(new InputStreamReader(contentProvider.get())); } catch (final IOException ex) { logger.error("Fail to open {}", getPath()); throw ex; } catch (final Throwable ex) { throw new IllegalStateException(ex); } } File(final Project project, final String path); BufferedReader open();  }
@Test(expected = IOException.class) public void shouldThrowIOException() throws IOException { final Project project = new Project(randomUUID().toString(), new ProjectFile()); final File file = new File(project, randomUUID().toString()); file.open(); }