private static ContextType chooseType(ContextType first, ContextType second) {
    return first.getPriority() > second.getPriority() ? first : second;
  }
private static ContextType chooseType(ContextType first, ContextType second)