code: private static String[] getAttributeValues(final RDNSequence rdnSequence, final AttributeType attribute) {
          val values = new ArrayList<String>();
          for (val rdn : rdnSequence.backward()) {
              for (val attr : rdn.getAttributes()) {
                  if (attr.getType().equals(attribute)) {
                      values.add(attr.getValue());
                  }
              }
          }
          return values.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
      }
docs: Gets the values of the given attribute contained in the DN.
  <p>
  <p><strong>NOTE:</strong> no escaping is done on special characters in the
  values, which could be different from what would appear in the string
  representation of the DN.</p>
  Iterates sequence in reverse order as specified in section 2.1 of RFC 2253.
  
  @param rdnSequence list of relative distinguished names
  that contains the attributes comprising the DN.
  @param attribute   Attribute whose values will be retrieved.
  @return The attribute values for the given attribute in the order they
  appear would appear in the string representation of the DN or an empty
  array if the given attribute does not exist.