SizeAssessor { static boolean hasExcessiveSize(InputFile file, Long maxFileSizeBytes) { return hasExcessiveSize(file::inputStream, maxFileSizeBytes); } private  SizeAssessor();   }
@Test public void testOnMisbehavedStuckInputStream() { SizeAssessor.SupplierThrowing<InputStream, IOException> brokenStreamSupplier = () -> new ByteArrayInputStream(new byte[0]) { @Override public int read(byte[] buffer, int offset, int len) { return 0; } }; assertThat(SizeAssessor.hasExcessiveSize(brokenStreamSupplier, 123)).isTrue(); }