Map<Object, AbstractDistinguishable> set = new HashMap<Object, AbstractDistinguishable>();
System.out.println("Constructing Sorted list");
for(WriteObjectAccess field: this){
Object obj = field.getObject();
if(obj instanceof AbstractDistinguishable){
AbstractDistinguishable dist = (AbstractDistinguishable) obj;
set.put(dist.getId(), dist);
}
}
System.out.println("Writelist " + set.size());
AbstractDistinguishable[] items = set.values().toArray(new AbstractDistinguishable[0]);
Arrays.sort(items, new Comparator<AbstractDistinguishable>() {