docs: private void getDescendants(Entity entity, LdapEntry ldapEntry, DescendantControl descCtrl) throws WIMException {
          if (descCtrl == null) {
              return;
          }
  
          List<String> propNames = descCtrl.getProperties();
          int level = descCtrl.getLevel();
          List<String> descTypes = getEntityTypes(descCtrl);
          String[] bases = getBases(descCtrl, descTypes);
          boolean treeView = descCtrl.isSetTreeView();
          int scope = SearchControls.ONELEVEL_SCOPE;
          if (level == 0 && !treeView) {
              scope = SearchControls.SUBTREE_SCOPE;
          }
          Set<String> descToDo = new HashSet<String>();
          Map<String, Entity> descendants = new HashMap<String, Entity>();
          Set<LdapEntry> descEntries = iLdapConn.searchEntities(ldapEntry.getDN(), "objectClass=*", null, scope, descTypes,
                                                                propNames, false, false);
          for (LdapEntry descEntry : descEntries) {
              String descType = descEntry.getType();
              String descDn = descEntry.getDN();
              Entity descendant = null;
              if (LdapHelper.isUnderBases(descDn, bases) && descTypes.contains(descType)) {
                  descendant = createEntityFromLdapEntry(entity, SchemaConstants.DO_CHILDREN, descEntry, propNames);
              } else if (treeView) {
                  descendant = createEntityFromLdapEntry(entity, SchemaConstants.DO_CHILDREN, descEntry, null);
              }
              if (treeView) {
                  descToDo.add(descDn);
                  descendants.put(descDn, descendant);
              }
          }
          if (treeView) {
              while (descToDo.size() > 0) {
                  Set<String> nextDescs = new HashSet<String>();
                  for (String dn : descToDo) {
                      Entity parent = descendants.get(dn);
                      descEntries = iLdapConn.searchEntities(dn, "objectClass=*", null, scope, descTypes, propNames,
                                                             false, false);
                      for (LdapEntry descEntry : descEntries) {
                          String descType = descEntry.getType();
                          String descDn = descEntry.getDN();
                          Entity descendant = null;
                          if (descTypes.contains(descType)) {
                              descendant = createEntityFromLdapEntry(parent, SchemaConstants.DO_CHILDREN, descEntry, propNames);
                          } else if (treeView) {
                              descendant = createEntityFromLdapEntry(parent, SchemaConstants.DO_CHILDREN, descEntry, null);
                          }
                          if (!descToDo.contains(descDn)) {
                              nextDescs.add(descDn);
                              descendants.put(descDn, descendant);
                          }
                      }
                  }
                  descToDo = nextDescs;
              }
          }
      }