List<UnresolvableCollisionUsageInfo> (Set<UsageInfo> usages) { final List<UnresolvableCollisionUsageInfo> result = new ArrayList<>(); for (Iterator<UsageInfo> iterator = usages.iterator(); iterator.hasNext();) { UsageInfo usageInfo = iterator.next(); if (usageInfo instanceof UnresolvableCollisionUsageInfo) { result.add((UnresolvableCollisionUsageInfo)usageInfo); iterator.remove(); } } return result.isEmpty() ? null : result; }