MinimalZipEntry { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MinimalZipEntry other = (MinimalZipEntry) obj; if (compressedSize != other.compressedSize) { return false; } if (compressionMethod != other.compressionMethod) { return false; } if (crc32OfUncompressedData != other.crc32OfUncompressedData) { return false; } if (!Arrays.equals(fileNameBytes, other.fileNameBytes)) { return false; } if (fileOffsetOfCompressedData != other.fileOffsetOfCompressedData) { return false; } if (fileOffsetOfLocalEntry != other.fileOffsetOfLocalEntry) { return false; } if (generalPurposeFlagBit11 != other.generalPurposeFlagBit11) { return false; } if (uncompressedSize != other.uncompressedSize) { return false; } return true; } MinimalZipEntry(
      int compressionMethod,
      long crc32OfUncompressedData,
      long compressedSize,
      long uncompressedSize,
      byte[] fileNameBytes,
      boolean generalPurposeFlagBit11,
      long fileOffsetOfLocalEntry); void setFileOffsetOfCompressedData(long offset); int getCompressionMethod(); long getCrc32OfUncompressedData(); long getCompressedSize(); long getUncompressedSize(); byte[] getFileNameBytes(); String getFileName(); boolean getGeneralPurposeFlagBit11(); long getFileOffsetOfLocalEntry(); long getFileOffsetOfCompressedData(); boolean isDeflateCompressed(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test @SuppressWarnings("EqualsIncompatibleType") public void testEquals() { Assert.assertEquals(defaultEntry, defaultEntry); MinimalZipEntry clonedDefaultEntry = new MinimalZipEntry( COMPRESSION_METHOD, CRC32, COMPRESSED_SIZE, UNCOMPRESSED_SIZE, FILE_NAME_BYTES, GENERAL_PURPOSE_BIT_FLAG_11, FILE_OFFSET_OF_LOCAL_ENTRY); Assert.assertEquals(defaultEntry, clonedDefaultEntry); for (MinimalZipEntry mutation : allMutations) { Assert.assertNotEquals(defaultEntry, mutation); } Assert.assertFalse(defaultEntry.equals(null)); Assert.assertFalse(defaultEntry.equals("foo")); }