StreamChain (@NotNull List<StreamChain> chains) { final List<StreamChain> orderedChains = new ArrayList<>(chains); orderedChains.sort(Comparator.comparingInt(x -> x.getText().length())); return orderedChains.get(myIndex); }