// "Replace with collect" "false" import java.util.*; public class Main { private Set test(String[] list, int limit) { Set result = new HashSet<>(); List other = new ArrayList<>(); System.out.println("hello"); for(String s : list) { if (s == null) { continue; } result.add(s+s); if(result.size() != limit) { continue; } break; } result.sort(null); return result; } }