private static <T extends Proto> void streamProtoCollection(DependencyContext context, PrintStream stream, final Collection<T> collection) {
    final List<T> list = new ArrayList<>(collection);
    list.sort(Comparator.comparingInt(o -> o.name));
    for (T reqRepr : list) {
      reqRepr.toStream(context, stream);
    }
  }
private static <T extends Proto> void streamProtoCollection(DependencyContext context, PrintStream stream, final Collection<T> collection)