### Question:
UncompressedAsicEntry extends AsicEntry { @Override public ZipEntry getZipEntry() { if (isRequiredMetadataMissing()) { throw new IllegalStateException("Missing metadata required for using STORED compression method"); } ZipEntry zipEntry = super.getZipEntry(); zipEntry.setMethod(ZipEntry.STORED); zipEntry.setCompressedSize(size); zipEntry.setSize(size); zipEntry.setCrc(crc); return zipEntry; } UncompressedAsicEntry(ZipEntry zipEntry); void updateMetadataIfNotPresent(Supplier<byte[]> contentBytesSupplier); @Override ZipEntry getZipEntry();  }### Answer:
@Test public void entryCreatesZipEntryWithValidMetadataIfProvidedInOriginal() { ZipEntry originalZipEntry = new ZipEntry(MOCK_ENTRY_NAME); originalZipEntry.setSize(123L); originalZipEntry.setCrc(2345L); AsicEntry asicEntry = new UncompressedAsicEntry(originalZipEntry); ZipEntry derivedZipEntry = asicEntry.getZipEntry(); assertZipEntry(derivedZipEntry, 123L, 2345L); }
@Test(expected = IllegalStateException.class) public void entryFailsToCreateZipEntryIfSizeIsMissing() { ZipEntry originalZipEntry = new ZipEntry(MOCK_ENTRY_NAME); originalZipEntry.setCrc(2345L); AsicEntry asicEntry = new UncompressedAsicEntry(originalZipEntry); asicEntry.getZipEntry(); }
@Test(expected = IllegalStateException.class) public void entryFailsToCreateZipEntryIfCrcIsMissing() { ZipEntry originalZipEntry = new ZipEntry(MOCK_ENTRY_NAME); originalZipEntry.setSize(123L); AsicEntry asicEntry = new UncompressedAsicEntry(originalZipEntry); asicEntry.getZipEntry(); }