### Question:
X509Cert implements Serializable { public String getSubjectName(SubjectName part) { logger.debug("Part: " + part); if (subjectNamePartMap == null) { loadSubjectNameParts(); } String subjectName = subjectNamePartMap.get(part.name()); logger.debug("Subject name: " + subjectName); return subjectName; } X509Cert(X509Certificate cert);   X509Cert(String path); List<String> getCertificatePolicies(); X509Certificate getX509Certificate(); String issuerName(Issuer part); String issuerName(); boolean isValid(Date date); boolean isValid(); List<KeyUsage> getKeyUsages(); String getSerial(); String getSubjectName(SubjectName part); String getSubjectName();  }### Answer:
@Test public void testGetPartOfSubjectName() throws Exception { Assert.assertEquals("11404176865", this.certificate.getSubjectName(X509Cert.SubjectName.SERIALNUMBER)); Assert.assertEquals("märü-lööz", this.certificate.getSubjectName(X509Cert.SubjectName.GIVENNAME).toLowerCase()); Assert.assertEquals("žõrinüwšky", this.certificate.getSubjectName(X509Cert.SubjectName.SURNAME).toLowerCase()); Assert.assertEquals("\"žõrinüwšky,märü-lööz,11404176865\"", this.certificate.getSubjectName(X509Cert.SubjectName.CN).toLowerCase()); Assert.assertEquals("digital signature", this.certificate.getSubjectName(X509Cert.SubjectName.OU).toLowerCase()); Assert.assertEquals("esteid", this.certificate.getSubjectName(X509Cert.SubjectName.O).toLowerCase()); Assert.assertEquals("ee", this.certificate.getSubjectName(X509Cert.SubjectName.C).toLowerCase()); }
@Test public void testGetSubjectName() throws Exception { Assert.assertEquals("SERIALNUMBER=11404176865, GIVENNAME=MÄRÜ-LÖÖZ, SURNAME=ŽÕRINÜWŠKY, CN=\"ŽÕRINÜWŠKY,MÄRÜ-LÖÖZ," + "11404176865\", OU=digital signature, O=ESTEID, C=EE", this.certificate.getSubjectName()); }