$handlers = new HashSet(handlers);
$handlers = handlers; Collections.sort($handlers, $handlerComparator);
  public final Set getInstanceHandlers() {    if ($handlers == null) {      LOG.debug("no handlers cached; creating new handlers");      List handlers = new ArrayList();      List beans = new ArrayList(getInstances());      LOG.debug("retrieved instances");      LOG.debug("creating handler for each instance");      Iterator iter = beans.iterator();      while (iter.hasNext()) {        PersistentBean bean = (PersistentBean)iter.next();        LOG.debug("    instance is " + bean);        InstanceHandler handler = (InstanceHandler)InstanceHandler.RESOLVER.freshHandlerFor(bean.getClass(), getDao());        handler.setInstance(bean);        handler.setViewMode(InstanceHandler.VIEWMODE_DISPLAY);        LOG.debug("    handler is " + handler);        handlers.add(handler);      }      $handlers = new HashSet(handlers);      LOG.debug("handlers created and cached");    }    else {      LOG.debug("returning cached handlers");    }    return $handlers;  }