boolean (Object obj) { if(!(obj instanceof SmartTodoItemPointer pointer)){ return false; } if (!(myTodoItem.getFile().equals(pointer.myTodoItem.getFile())&& myRangeMarker.getStartOffset()==pointer.myRangeMarker.getStartOffset()&& myRangeMarker.getEndOffset()==pointer.myRangeMarker.getEndOffset()&& myTodoItem.getPattern().equals(pointer.myTodoItem.getPattern()) && myAdditionalRangeMarkers.size() == pointer.myAdditionalRangeMarkers.size())) { return false; } for (int i = 0; i < myAdditionalRangeMarkers.size(); i++) { RangeMarker m1 = myAdditionalRangeMarkers.get(i); RangeMarker m2 = pointer.myAdditionalRangeMarkers.get(i); if (m1.getStartOffset() != m2.getStartOffset() || m1.getEndOffset() != m2.getEndOffset()) { return false; } } return true; }