code: public synchronized Object findObject(Class<?> clazz, Object previousInstance) {
          int i = previousInstance == null ? -1 : MiscUtil.indexOfInstance(registeredObjects, previousInstance);
          
          for (i++; i < registeredObjects.size(); i++) {
              Object object = registeredObjects.get(i);
              
              if (clazz.isInstance(object)) {
                  return object;
              }
          }
          
          return null;
      }
docs: Finds a registered object belonging to the specified class.
  
  @param clazz Returned object must be assignment-compatible with this class.
  @param previousInstance Previous instance returned by this call. Search will start with the
  entry that follows this one in the list. If this parameter is null, the search
  starts at the beginning.
  @return Reference to the discovered object or null if none found.