### Question:
Certificate extends ArchivableEntity { protected static String getOrganization(final String distinguishedName) { String organization = null; if (distinguishedName.isEmpty()) { return null; } X500Name name = new X500Name(distinguishedName); if (name.getRDNs(RFC4519Style.o).length > 0) { RDN rdn = name.getRDNs(RFC4519Style.o)[0]; if (rdn.isMultiValued()) { for (AttributeTypeAndValue att: rdn.getTypesAndValues()) { if (RFC4519Style.o.equals(att.getType())) { organization = att.getValue().toString(); } } } else { organization = rdn.getFirst().getValue().toString(); } } return organization; } 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 testGetSingleOrganization() throws IOException { String parsedOrg = Certificate.getOrganization(RDN_COMMA_SEPARATED); Assert.assertEquals(RDN_COMMA_SEPARATED_ORGANIZATION, parsedOrg); }
@Test public void testGetMultiRdnOrganization() throws IOException { String parsedOrg = Certificate.getOrganization(RDN_MULTIVALUE); Assert.assertEquals(RDN_MULTIVALUE_ORGANIZATION, parsedOrg); }