public static <R> R traverseSupers(@NotNull JvmClass start, boolean skipStart, @NotNull Function<? super JvmClass, R> f) {
    // TODO implement method returning Stream<JvmClass>
    final Queue<JvmClass> queue = new ArrayDeque<>();
    if (skipStart) {
      queueSupers(queue, start);
    }
    else {
      queue.offer(start);
    }

    final Set<JvmClass> visited = new HashSet<>();
    while (!queue.isEmpty()) {
      ProgressManager.checkCanceled();

      JvmClass current = queue.remove();
      if (!visited.add(current)) continue;

      R result = f.apply(current);
      if (result != null) return result;

      queueSupers(queue, current);
    }

    return null;
  }
public static <R> R traverseSupers(@NotNull JvmClass start, boolean skipStart, @NotNull Function<? super JvmClass, R> f)