### Question:
ManagedObjectPath { public DN toDN() { DNSerializer serializer = new DNSerializer(); serialize(serializer); return serializer.toDN(); } private  ManagedObjectPath(LinkedList<Element<?, ?>> elements, RelationDefinition<? super C, ? super S> r,
        AbstractManagedObjectDefinition<C, S> d); static ManagedObjectPath<RootCfgClient, RootCfg> emptyPath(); static ManagedObjectPath<?, ?> valueOf(String s); ManagedObjectPath<C1, S1> asSubType(AbstractManagedObjectDefinition<C1, S1> nd); ManagedObjectPath<M, N> child(
        InstantiableRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d, String name); ManagedObjectPath<M, N> child(
        InstantiableRelationDefinition<M, N> r, String name); ManagedObjectPath<M, N> child(
        OptionalRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d); ManagedObjectPath<M, N> child(
        OptionalRelationDefinition<M, N> r); ManagedObjectPath<M, N> child(
        SingletonRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d); ManagedObjectPath<M, N> child(
        SingletonRelationDefinition<M, N> r); ManagedObjectPath<M, N> child(
        SetRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d); ManagedObjectPath<? extends M, ? extends N> child(
        SetRelationDefinition<M, N> r, String name); ManagedObjectPath<M, N> child(
        SetRelationDefinition<M, N> r); @Override boolean equals(Object obj); AbstractManagedObjectDefinition<C, S> getManagedObjectDefinition(); String getName(); RelationDefinition<? super C, ? super S> getRelationDefinition(); @Override int hashCode(); boolean isEmpty(); boolean matches(ManagedObjectPath<?, ?> other); ManagedObjectPath<?, ?> parent(); ManagedObjectPath<?, ?> parent(int offset); ManagedObjectPath<C, S> rename(String newName); void serialize(ManagedObjectPathSerializer serializer); int size(); DN toDN(); @Override String toString(); void toString(final StringBuilder builder);  }### Answer:
@Test public void testToDN() throws Exception { ManagedObjectPath<?, ?> path = ManagedObjectPath.emptyPath(); ManagedObjectPath<ConnectionHandlerCfgClient, ConnectionHandlerCfg> child1 = path.child(RootCfgDefn .getInstance().getConnectionHandlersRelationDefinition(), "LDAP connection handler"); ManagedObjectPath<LDAPConnectionHandlerCfgClient, LDAPConnectionHandlerCfg> child2 = path.child(RootCfgDefn .getInstance().getConnectionHandlersRelationDefinition(), LDAPConnectionHandlerCfgDefn.getInstance(), "LDAP connection handler"); ManagedObjectPath<LDAPConnectionHandlerCfgClient, LDAPConnectionHandlerCfg> child3 = path.child(RootCfgDefn .getInstance().getConnectionHandlersRelationDefinition(), LDAPConnectionHandlerCfgDefn.getInstance(), "Another LDAP connection handler"); DN expectedEmpty = DN.rootDN(); DN expectedChild1 = DN.valueOf("cn=LDAP connection handler,cn=connection handlers,cn=config"); DN expectedChild2 = DN.valueOf("cn=LDAP connection handler,cn=connection handlers,cn=config"); DN expectedChild3 = DN.valueOf("cn=Another LDAP connection handler,cn=connection handlers,cn=config"); assertEquals(path.toDN(), expectedEmpty); assertEquals(child1.toDN(), expectedChild1); assertEquals(child2.toDN(), expectedChild2); assertEquals(child3.toDN(), expectedChild3); }