code: public <T extends LiquibaseListener> Collection<T> getListeners(Class<T> type) {
          List<T> returnList = new ArrayList<>();
  
          Scope scopeToCheck = this;
          while (scopeToCheck != null) {
              if (scopeToCheck.listener != null && type.isAssignableFrom(scopeToCheck.listener.getClass())) {
                  returnList.add((T) scopeToCheck.listener);
              }
              scopeToCheck = scopeToCheck.getParent();
          }
  
          return returnList;
      }
docs: Returns {@link LiquibaseListener}s defined in this scope and/or all its parents that are of the given type.