@Test public void testRemove() { EventList<Integer> source = new BasicEventList<>(); FunctionList<Integer, String> intsToStrings = new FunctionList<>(source, new IntegerToString(), new StringToInteger()); ListConsistencyListener.install(intsToStrings); source.add(ZERO); source.add(ONE); source.add(TWO); intsToStrings.remove(0); assertEquals("1", intsToStrings.get(0)); assertEquals("2", intsToStrings.get(1)); source.remove(0); assertEquals("2", intsToStrings.get(0)); }
@Override public E remove(int index) { final E removed = get(index); source.remove(index); return removed; }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public E remove(int index) { final E removed = get(index); source.remove(index); return removed; } }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public E remove(int index) { final E removed = get(index); source.remove(index); return removed; } FunctionList(EventList<S> source, Function<S,E> forward);  FunctionList(EventList<S> source, Function<S,E> forward, Function<E,S> reverse); }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public E remove(int index) { final E removed = get(index); source.remove(index); return removed; } FunctionList(EventList<S> source, Function<S,E> forward);  FunctionList(EventList<S> source, Function<S,E> forward, Function<E,S> reverse); void setForwardFunction(Function<S,E> forward); Function<S,E> getForwardFunction(); void setReverseFunction(Function<E,S> reverse); Function<E,S> getReverseFunction(); @Override void listChanged(ListEvent<S> listChanges); @Override E get(int index); @Override E remove(int index); @Override E set(int index, E value); @Override void add(int index, E value); @Override boolean removeIf(Predicate<? super E> filter); }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public E remove(int index) { final E removed = get(index); source.remove(index); return removed; } FunctionList(EventList<S> source, Function<S,E> forward);  FunctionList(EventList<S> source, Function<S,E> forward, Function<E,S> reverse); void setForwardFunction(Function<S,E> forward); Function<S,E> getForwardFunction(); void setReverseFunction(Function<E,S> reverse); Function<E,S> getReverseFunction(); @Override void listChanged(ListEvent<S> listChanges); @Override E get(int index); @Override E remove(int index); @Override E set(int index, E value); @Override void add(int index, E value); @Override boolean removeIf(Predicate<? super E> filter);  }