@Test
public void testLocateStartOfEocd_WithFile_NoEocd() throws IOException {

  // Create a temp file with some zeroes and no EOCD header at all
  File tempFile = File.createTempFile("MinimalZipParserTest", "zip");
  tempFile.deleteOnExit();
  try {
    FileOutputStream out = new FileOutputStream(tempFile);
    out.write(new byte[4000]);
    out.flush();
    out.close();
  } catch (IOException e) {
    try {
      tempFile.delete();
    } catch (Exception ignored) {
      // Nothing
    }
    throw e;
  }
  // Now expect to find no EOCD.
  try (RandomAccessFileInputStream in = new RandomAccessFileInputStream(tempFile)) {
    long eocdOffset = MinimalZipParser.locateStartOfEocd(in, 4000);
    Assert.assertEquals(-1, eocdOffset);
  }
}