@@ -0,0 +1,1153 @@
+package pete.metrics.adaptability.elements;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aclass DetectionOnlyElements %7B%0A%0A%09private final Collection%3CAdaptableElement%3E elements;%0A%0A%09public DetectionOnlyElements() %7B%0A%09%09elements = new HashSet%3C%3E();%0A%09%7D%0A%0A%09private void addToSet(AdaptableElement element) %7B%0A%09%09boolean success = elements.add(element);%0A%09%09if (!success) %7B%0A%09%09%09throw new IllegalStateException(element.getName()%0A%09%09%09%09%09+ %22 was tried to be added twice%22);%0A%09%09%7D%0A%09%7D%0A%0A%09public List%3CString%3E getElementNames() %7B%0A%09%09List%3CString%3E result = new ArrayList%3C%3E(elements.size());%0A%09%09elements.forEach(element -%3E result.add(element.getName()));%0A%09%09return result;%0A%09%7D%0A%0A%09public List%3CAdaptableElement%3E getElements() %7B%0A%09%09List%3CAdaptableElement%3E result = new ArrayList%3C%3E(elements.size());%0A%09%09elements.forEach(element -%3E result.add(element));%0A%09%09return result;%0A%09%7D%0A%0A%09public Map%3CString, AdaptableElement%3E getElementsByName() %7B%0A%09%09HashMap%3CString, AdaptableElement%3E result = new HashMap%3C%3E();%0A%09%09elements.forEach(element -%3E result.put(element.getName(), element));%0A%09%09return result;%0A%09%7D%0A%0A%7D%0A

Add collection of elements that should only be detected