Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/updatables/ListToSetAdapter.java
protected Collection computeElements() {
		
		if (elements != null) {
			return elements;
		}
		
		
		return doComputeElements();
	}
	protected void firstListenerAdded() {
		input.addChangeListener(listener);
		elements = doComputeElements();
		super.firstListenerAdded();
	}
	
	protected void lastListenerRemoved() {
		input.removeChangeListener(listener);
		elements = null;
		super.lastListenerRemoved();
	}
	
	private HashSet doComputeElements() {
		elements = new HashSet();
		for (int idx = 0; idx < input.getSize(); idx++) {
			elements.add(input.getElement(idx));
		}
		return elements;
	}
}