boolean (@Nullable Object obj) { if (obj == this) { return true; } if (obj == null || !getClass().equals(obj.getClass())) { return false; } DisposableWrapper other = (DisposableWrapper)obj; try { return delegate.equals(other.delegate) && !isUnique() && !other.isUnique(); } catch (ClassCastException e) { throw new RuntimeException("failed DisposableWrapper.equals(" + classInfo(other.delegate) + "; this.delegate=" + classInfo(delegate) + ". Whole list=" + myWrappedList, e); } }