void (boolean newOptionValue, SearchContext option) { boolean changed = false; if (newOptionValue) { changed = searchContext != option; searchContext = option; } else if (searchContext == option) { // do not reset unrelated value changed = true; searchContext = SearchContext.ANY; } if (changed) { notifyObservers(); } }