@Override
    public void clear() {
        int oldSize = size();
        super.clear();
        if (oldSize != 0) {
            notifyRemove(0, oldSize);
        }
    }
An {@link ObservableList} implementation using ArrayList as an implementation.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/obs/ObservableArrayList.java