void (List<String> descriptions) { Collections.sort(descriptions, (o1, o2) -> { final int elementsDiff = o1.length() - o2.length(); if (elementsDiff == 0) { return <error descr="Bad return type in lambda expression: boolean cannot be converted to int">o1.equals(o2)</error>; } return -elementsDiff; }); }