### Question:
ClasspathDigester { public Serializable digest(List<Path> classpath) throws IOException { MessageDigest digester = SHA1Digester.newInstance(); for (Path file : classpath) { String cacheKey = file.toFile().getCanonicalPath().toString(); byte[] hash = cache.get(cacheKey); if (hash == null) { if (Files.isRegularFile(file)) { hash = digestZip(file); } else if (Files.isDirectory(file)) { hash = digestDir(file); } else { hash = new byte[0]; } cache.put(cacheKey, hash); } digester.update(hash); } return new BytesHash(digester.digest()); } ClasspathDigester(ConcurrentMap<String, byte[]> cache);  ClasspathDigester(); Serializable digest(List<Path> classpath);  }### Answer:
@Test public void testCorruptedZip() throws Exception { File jar = temp.newFile().getCanonicalFile(); Serializable corrupted = new ClasspathDigester().digest(Collections.singletonList(jar.toPath())); assertThat(corrupted).isNotNull(); JarBuilder.create(jar).withEntry("entry", "contents").build(); Serializable legit = new ClasspathDigester().digest(Collections.singletonList(jar.toPath())); assertThat(legit).isNotNull(); assertThat(corrupted).isNotEqualTo(legit); }