// "Replace Stream API chain with loop" "true" import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { public long test(List list) { long count = 0; Set uniqueValues = new HashSet<>(); for (String s : list) { if (uniqueValues.add(s)) { count++; } } return count; } }