@Test public void testRemove() throws InvalidNameException { String testPath = "cn=john.doe, OU=Users,OU=Some Company,OU=G,OU=I,OU=M"; DistinguishedName path = new DistinguishedName(testPath); path.remove(1); path.remove(3); assertThat(path.toString()).isEqualTo("cn=john.doe,ou=Some Company,ou=G,ou=M"); }