
import java.util.*;

class Ideone {
	public static void main (String[] args) {
		List<Integer> list = new ArrayList<>(
			Arrays.asList(6, 4, 5, 6, 0, 6, 3, 4, 1, 6, 1, 6, 0, 6, 8, 3));
	    List<Integer> subList = Arrays.asList(6, 0, 6);
	    
		removeAllSubList(list, subList);
		System.out.println(list);
	}
	
	public static void removeAllSubList(List<?> list, List<?> subList) {
    	// find first occurrence of the subList in the list, O(nm)
    	int i = Collections.indexOfSubList(list, subList);
    	// if found
    	if (i != -1) {
        	// bulk remove, O(m)
        	list.subList(i, i + subList.size()).clear();
        	// recurse with the rest of the list
        	removeAllSubList(list.subList(i, list.size()), subList);
    	}
    }
}