baku-toolkit/lib/src/main/java/io/v/baku/toolkit/bind/DerivedListDeltaAccumulator.java
/**
         * @param start the mutable ordered start state
         * @param goal  the elements in the end state
         * @return the result of retaining `goal` from `start`
         */
@param start the mutable ordered start state
@param goal  the elements in the end state
@return the result of retaining `goal` from `start`
@param start the mutable ordered start state @param goal the elements in the end state @return the result of retaining ` goal ` from ` start `
List<T> processRemovals(final ImmutableList<T> start, final ImmutableSet<T> goal) {
            final List<T> working = new ArrayList<>(start);
            int removalCount = 0, i = 0;
            for (final T item : start) {
                if (goal.contains(item)) {
                    processRemovals(working, i, removalCount);
                    i++;
                    removalCount = 0;
                } else {
                    removalCount++;
                }
            }
            processRemovals(working, i, removalCount);
            return working;
        }
List < T > processRemovals ( final ImmutableList < T > start , final ImmutableSet < T > goal ) { final List < T > working = new ArrayList < > ( start ) ; int removalCount = 0 , i = 0 ; for ( final T item : start ) { if ( goal . contains ( item ) ) { processRemovals ( working , i , removalCount ) ; i ++ ; removalCount = 0 ; } else { removalCount ++ ; } } processRemovals ( working , i , removalCount ) ; return working ; }
@param start the mutable ordered start state
 @param goal  the elements in the end state
 @return the result of retaining `goal` from `start`
@param start the mutable ordered start state @param goal the elements in the end state @return the result of retaining ` goal ` from ` start `