Bug 159940 [DataBinding] DataBindingContext shouldn't expose the bindings list as a mutable list
Currently in DataBindingContext getBindings() exposes the bindings observable list as a mutable observable list. I think we need to make this an unmodifiable list and also add a removeBinding(Binding binding) method to the API of DataBindingContext so that the DBC can remove itself from the binding when removed from the DBC. I'll create a patch soon.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
assertNotNull(dbc.getBindings());
        assertEquals(1, dbc.getBindings().size());
        assertEquals(binding, dbc.getBindings().get(0));
    }
    /**
     * Asserts that when
     * {@link DataBindingContext#bindList(IObservableList, IObservableList, org.eclipse.jface.databinding.BindSpec)}
     * is invoked the created binding is added to the intenal list of bindings.
     * 
     * @throws Exception
     */
    public void testBindListAddBinding() throws Exception {
        WritableList targetList = new WritableList(Object.class);
        WritableList modelList = new WritableList(Object.class);
        org.eclipse.jface.databinding.DataBindingContext dbc = org.eclipse.jface.databinding.DataBindingContext.withDefaults();
        assertNotNull(dbc.getBindings());
        assertEquals(0, dbc.getBindings().size());
        org.eclipse.jface.databinding.Binding binding = dbc.bindList(targetList, modelList, null);
        assertNotNull(binding);
        assertNotNull(dbc.getBindings());
        assertEquals(1, dbc.getBindings().size());
        assertEquals(binding, dbc.getBindings().get(0));
    }
    /**
     * {@link IValueChangeListener} implementation that counts the times
     * handleValueChange(...) is invoked.
     * 
     * @since 3.2
     */
    private static class ValueChangeCounter implements IValueChangeListener {