### Question:
DnUtils { public static String getUserDN(String[] dns) { return getUserDN(dns, false); }  static String[] splitProxiedDNs(String proxiedDNs, boolean allowDups); static String[] splitProxiedSubjectIssuerDNs(String proxiedDNs); static String buildProxiedDN(String... dns); static Collection<String> buildNormalizedDNList(String subjectDN, String issuerDN, String proxiedSubjectDNs, String proxiedIssuerDNs); static String buildNormalizedProxyDN(String subjectDN, String issuerDN, String proxiedSubjectDNs, String proxiedIssuerDNs); static String getCommonName(String dn); static String[] getOrganizationalUnits(String dn); static String getShortName(String dn); static boolean isServerDN(String dn); static String getUserDN(String[] dns); static String getUserDN(String[] dns, boolean issuerDNs); static String[] getComponents(String dn, String componentName); static String normalizeDN(String userName); static final String PROPS_RESOURCE; static final String SUBJECT_DN_PATTERN_PROPERTY; }### Answer:
@Test public void testGetUserDnFromArray() { String userDnForTest = "snd1"; String[] array = new String[] {userDnForTest, "idn"}; String userDN = DnUtils.getUserDN(array); assertEquals(userDnForTest, userDN); }
@Test(expected = IllegalArgumentException.class) public void testTest() { String[] dns = new String[] {"sdn"}; DnUtils.getUserDN(dns, true); }