boolean (@NotNull FileEditorState otherState, @NotNull FileEditorStateLevel level) { return otherState instanceof MyFileEditorState && (myFirstState == null || myFirstState.canBeMergedWith(((MyFileEditorState)otherState).myFirstState, level)) && (mySecondState == null || mySecondState.canBeMergedWith(((MyFileEditorState)otherState).mySecondState, level)); }