### Question:
LDAPProfile { public List<String> getObjectClasses(AbstractManagedObjectDefinition<?, ?> d) throws MissingResourceException { LinkedList<String> objectClasses = new LinkedList<>(); Set<String> s = new HashSet<>(); while (d != null) { String oc = getObjectClass(d); if (!s.contains(oc)) { objectClasses.addFirst(oc); s.add(oc); } d = d.getParent(); } if (!s.contains("top")) { objectClasses.addFirst("top"); } return objectClasses; } private  LDAPProfile(); static LDAPProfile getInstance(); String getAttributeName(AbstractManagedObjectDefinition<?, ?> d,
      PropertyDefinition<?> pd); String getRelationChildRDNType(
      InstantiableRelationDefinition<?, ?> r); List<String> getRelationObjectClasses(
      RelationDefinition<?, ?> r); String getRelationChildRDNType(SetRelationDefinition<?, ?> r); String getObjectClass(AbstractManagedObjectDefinition<?, ?> d); List<String> getObjectClasses(AbstractManagedObjectDefinition<?, ?> d); String getRelationRDNSequence(RelationDefinition<?, ?> r); void popWrapper(); void pushWrapper(Wrapper wrapper);  }### Answer:
@Test public void testGetObjectClasses() { LDAPProfile lp = LDAPProfile.getInstance(); List<String> ocs = lp.getObjectClasses(GlobalCfgDefn.getInstance()); assertTrue(ocs.contains("top")); }