class TopologicalSort {

    public static List<Vertex> sort(Collection<? extends Vertex> vertices) {
        return vertices
            .stream()
            .sorted(Comparator.comparing(Vertex::getId, Comparator.naturalOrder()))
            .collect(Collectors.toList());
    }

    private  TopologicalSort();

}