@Test public void fail_if_file_does_not_exist() throws IOException { File file = temp.newFile("does_not_exist"); file.delete(); thrown.expect(IllegalStateException.class); thrown.expectMessage("Fail to compute hash of: " + file.getAbsolutePath()); new FileHashes().of(file); }
String of(File file) { try { return of(new FileInputStream(file)); } catch (IOException e) { throw new IllegalStateException("Fail to compute hash of: " + file.getAbsolutePath(), e); } }
FileHashes { String of(File file) { try { return of(new FileInputStream(file)); } catch (IOException e) { throw new IllegalStateException("Fail to compute hash of: " + file.getAbsolutePath(), e); } } }
FileHashes { String of(File file) { try { return of(new FileInputStream(file)); } catch (IOException e) { throw new IllegalStateException("Fail to compute hash of: " + file.getAbsolutePath(), e); } }  }
FileHashes { String of(File file) { try { return of(new FileInputStream(file)); } catch (IOException e) { throw new IllegalStateException("Fail to compute hash of: " + file.getAbsolutePath(), e); } }   }
FileHashes { String of(File file) { try { return of(new FileInputStream(file)); } catch (IOException e) { throw new IllegalStateException("Fail to compute hash of: " + file.getAbsolutePath(), e); } }    }