/**
   * Overwrites the configuration values with the values of the passed context if those values are
   * not null and aren't empty.
   *
   * @param context context to overwrite configuration with
   */
  public void overwriteWithContext(ConfigContext context) {
    if (isPresent(context.getEnvironment())) {
      this.environment = context.getEnvironment();
    }

    if (context.getHoneybadgerUrl() != null) {
      this.honeybadgerUrl = context.getHoneybadgerUrl();
    }

    if (isPresent(context.getApiKey())) {
      this.apiKey = context.getApiKey();
    }

    if (isPresent(context.getExcludedSysProps())) {
      // We always create a new instance so we can be sure that these
      // default values are included
      Set<String> set = new HashSet<>(context.getExcludedSysProps());
      set.add(HONEYBADGER_API_KEY);
      set.add(HONEYBADGER_EXCLUDED_PROPS_KEY);
      set.add(HONEYBADGER_URL_KEY);

      this.excludedSysProps = set;
    }

    if (isPresent(context.getExcludedParams())) {
      this.excludedParams = context.getExcludedParams();
    }

    if (isPresent(context.getExcludedClasses())) {
      this.excludedClasses = context.getExcludedClasses();
    }

    if (isPresent(context.getApplicationPackage())) {
      this.applicationPackage = context.getApplicationPackage();
    }

    if (isPresent(context.getHoneybadgerReadApiKey())) {
      this.honeybadgerReadApiKey = context.getHoneybadgerReadApiKey();
    }

    if (context.isFeedbackFormDisplayed() != null) {
      this.feedbackFormDisplayed = context.isFeedbackFormDisplayed();
    }

    if (isPresent(context.getFeedbackFormPath())) {
      this.feedbackFormPath = context.getFeedbackFormPath();
    }
  }