boolean (Object o) { if (!(o instanceof TextEditorState textEditorState)) { return false; } if (!Arrays.equals(CARETS, textEditorState.CARETS)) return false; if (relativeCaretPosition != textEditorState.relativeCaretPosition) return false; CodeFoldingState localFoldingState = getFoldingState(); CodeFoldingState theirFoldingState = textEditorState.getFoldingState(); return Objects.equals(localFoldingState, theirFoldingState); }