code: public static Dictionary<String,String> addToFilter(Dictionary<String,String> filter, String key, String value, boolean cloneFilter)
      {
          Dictionary<String,String> newFilter = filter;
          if ((cloneFilter) || (filter == null))
          {
              newFilter = new Hashtable<String,String>();
              if (filter != null)
              {
                  Enumeration<String> keys = filter.keys();
                  while (keys.hasMoreElements())
                  {
                      String filterKey = keys.nextElement();
                      newFilter.put(filterKey, filter.get(filterKey));
                  }
              }
          }
          if (value != null) 
              newFilter.put(key, value);
          return newFilter;
      }
docs: Add this key and value to this (Dictionary) filter.