### Question:
Certificate extends ArchivableEntity { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Certificate that = (Certificate) o; return Arrays.equals(certificateBytes, that.certificateBytes); } protected  Certificate();  Certificate(final Path certificatePath); @SuppressWarnings("methodlength")  Certificate(final byte[] certificateBytes); int getX509CredentialVersion(); boolean isIssuer(final Certificate issuer); boolean isValidOn(final Date date); @JsonIgnore X509Certificate getX509Certificate(); @JsonIgnore X509AttributeCertificateHolder getX509AttributeCertificateHolder(); @JsonIgnore AttributeCertificate getAttributeCertificate(); String getAuthInfoAccess(); String getAuthKeyId(); String getCrlPoints(); byte[] getPolicyConstraints(); String getKeyUsage(); String getExtendedKeyUsage(); String getSignatureAlgorithm(); String getPublicKeyAlgorithm(); BigInteger getSerialNumber(); BigInteger getAuthoritySerialNumber(); BigInteger getHolderSerialNumber(); String getHolderIssuer(); String getIssuer(); String getSubject(); int getPublicKeySize(); byte[] getEncodedPublicKey(); String getPublicKeyModulusHexValue(); byte[] getSignature(); Date getBeginValidity(); Date getEndValidity(); int getCertificateHash(); String getIssuerOrganization(); String getSubjectOrganization(); @JsonIgnore byte[] getRawBytes(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static byte[] readBytes(final Path certificatePath); static BigInteger getPublicKeyModulus(final X509Certificate certificate); static BigInteger getPublicKeyModulus(final PublicKey publicKey); static X500Name[] getAttributeCertificateIssuerNames(final AttCertIssuer issuer); static Date recoverDate(final ASN1GeneralizedTime time); static final int HEX_BASE; static final int MIN_ATTR_CERT_LENGTH; static final String ID_FIELD; static final String ARCHIVE_FIELD; static final String SERIAL_NUMBER_FIELD; static final String ISSUER_FIELD; static final String SUBJECT_FIELD; static final String ISSUER_ORGANIZATION_FIELD; static final String SUBJECT_ORGANIZATION_FIELD; static final String ENCODED_PUBLIC_KEY_FIELD; static final String PUBLIC_KEY_MODULUS_FIELD; static final String CERTIFICATE_HASH_FIELD; static final String HOLDER_SERIAL_NUMBER_FIELD; }### Answer:
@Test public void testEquals() throws CertificateException, IOException, URISyntaxException { Assert.assertEquals( getTestCertificate(FAKE_ROOT_CA_FILE), getTestCertificate(FAKE_ROOT_CA_FILE) ); Assert.assertEquals( new CertificateAuthorityCredential( Paths.get(this.getClass().getResource(FAKE_ROOT_CA_FILE).toURI()) ), new CertificateAuthorityCredential( Files.readAllBytes( Paths.get(this.getClass().getResource(FAKE_ROOT_CA_FILE).toURI()) ) ) ); Assert.assertNotEquals( getTestCertificate(CertificateAuthorityCredential.class, FAKE_ROOT_CA_FILE), getTestCertificate(CertificateAuthorityCredential.class, FAKE_INTEL_INT_CA_FILE) ); Assert.assertNotEquals( getTestCertificate(CertificateAuthorityCredential.class, FAKE_ROOT_CA_FILE), getTestCertificate(ConformanceCredential.class, FAKE_ROOT_CA_FILE) ); Assert.assertNotEquals( getTestCertificate(CertificateAuthorityCredential.class, FAKE_ROOT_CA_FILE), null ); }