- Collections.sort(list, (o1, o2) -> {
- if (o1.getRootIdentifier().getPathArguments().size() < o2.getRootIdentifier().getPathArguments().size()) {
- return -1;
- } else if (o1.getRootIdentifier().getPathArguments().size()
- == o2.getRootIdentifier().getPathArguments().size()) {
- return 0;
- } else {
- return 1;
- }
- });
- list.forEach(this::createShardFrontend);
+ additions
+ .stream()
+ .sorted(Comparator.comparingInt(o -> o.getRootIdentifier().getPathArguments().size()))
+ .forEachOrdered(this::createShardFrontend);