### Question:
ManagedObjectPath { public boolean matches(ManagedObjectPath<?, ?> other) { DN thisDN = toDN(); DN otherDN = other.toDN(); return thisDN.equals(otherDN); } 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); @SuppressWarnings("unchecked") ManagedObjectPath<CC, SS> asSubType(
      AbstractManagedObjectDefinition<CC, SS> 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 testMatches() { 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"); assertTrue(child1.matches(child1)); assertTrue(child2.matches(child2)); assertTrue(child1.matches(child2)); assertTrue(child2.matches(child1)); assertEquals(child1, child1); assertEquals(child2, child2); assertNotEquals(child1, child2); assertNotEquals(child2, child1); assertFalse(child1.matches(child3)); assertFalse(child2.matches(child3)); assertFalse(child3.matches(child1)); assertFalse(child3.matches(child2)); assertNotEquals(child1, child3); assertNotEquals(child2, child3); assertNotEquals(child3, child1); assertNotEquals(child3, child2); }