code: private void setKeywordValue(String keywordName, String value, boolean reset) {
          if (keywordName == null) {
              if (reset) {
                  // force new map, ignore value
                  keywords = Collections.<String, String>emptyMap();
              }
          } else {
              keywordName = AsciiUtil.toLowerString(keywordName.trim());
              if (keywordName.length() == 0) {
                  throw new IllegalArgumentException("keyword must not be empty");
              }
              if (value != null) {
                  value = value.trim();
                  if (value.length() == 0) {
                      throw new IllegalArgumentException("value must not be empty");
                  }
              }
              Map<String, String> m = getKeywordMap();
              if (m.isEmpty()) { // it is EMPTY_MAP
                  if (value != null) {
                      // force new map
                      keywords = new TreeMap<String, String>(getKeyComparator());
                      keywords.put(keywordName, value.trim());
                  }
              } else {
                  if (reset || !m.containsKey(keywordName)) {
                      if (value != null) {
                          m.put(keywordName, value);
                      } else {
                          m.remove(keywordName);
                          if (m.isEmpty()) {
                              // force new map
                              keywords = Collections.<String, String>emptyMap();
                          }
                      }
                  }
              }
          }
      }
docs: Set the value for the named keyword, or unset it if value is null.  If
  keywordName itself is null, unset all keywords.  If keywordName is not null,
  value must not be null.  If reset is true, ignore any previous value for
  the keyword, otherwise do not change the keyword (including removal of
  one or all keywords).