List<ConfigurableUsageTarget> () { synchronized (myHistory) { List<ConfigurableUsageTarget> result = new ArrayList<>(); final Set<ConfigurableUsageTarget> entries = myHistory.keySet(); for (Iterator<ConfigurableUsageTarget> iterator = entries.iterator(); iterator.hasNext(); ) { final ConfigurableUsageTarget target = iterator.next(); if (!target.isValid()) { iterator.remove(); } else { result.add(target); } } return result; } }