### Question:
RDN implements Comparable<RDN> { @Override public int compareTo(RDN rdn) { return toNormalizedByteString().compareTo(rdn.toNormalizedByteString()); } @SuppressWarnings("unchecked")  RDN(AttributeType attributeType, ByteString attributeValue); @SuppressWarnings("unchecked")  RDN(AttributeType attributeType, String attributeName, ByteString attributeValue); @SuppressWarnings("unchecked")  RDN(List<AttributeType> attributeTypes,
             List<String> attributeNames,
             List<ByteString> attributeValues); @SuppressWarnings("unchecked")  RDN(AttributeType[] attributeTypes, String[] attributeNames, ByteString[] attributeValues); static RDN create(AttributeType attributeType, ByteString attributeValue); int getNumValues(); boolean hasAttributeType(AttributeType attributeType); boolean hasAttributeType(String lowerName); AttributeType getAttributeType(int pos); String getAttributeName(int pos); ByteString getAttributeValue(AttributeType attributeType); ByteString getAttributeValue(int pos); boolean isMultiValued(); boolean hasValue(AttributeType type, ByteString value); static RDN decode(String rdnString); RDN duplicate(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); void toString(StringBuilder buffer); ByteStringBuilder toNormalizedByteString(ByteStringBuilder builder); @Override int compareTo(RDN rdn);  }### Answer:
@Test(dataProvider = "createRDNEqualityData") public void testCompareTo(String first, String second, int result) throws Exception { RDN rdn1 = RDN.decode(first); RDN rdn2 = RDN.decode(second); int rc = rdn1.compareTo(rdn2); if (rc < 0) { rc = -1; } else if (rc > 0) { rc = 1; } assertEquals(rc, result, "Comparison for <" + first + "> and <" + second + ">."); }