code: public List<T> resolve() {
          blockedBy = new HashMap<>();
          Set<T> queue = new LinkedHashSet<>();
          Set<T> allElements = new HashSet<>();
          queue.addAll(elements);
          while (!queue.isEmpty()) {
              T element = queue.iterator().next();
              Set<T> dependencies = dependencyProvider.getDependencies(element);
              queue.addAll(dependencies);
              blockedBy.put(element, dependencies);
              queue.remove(element);
              allElements.add(element);
          }
          List<T> result = new LinkedList<>();
          for (T element : allElements) {
              resolve(element, result);
          }
          return result;
      }
docs: Resolves the dependencies to a list.
  
  @return The resolved list.