code: public Set<String> keys(String pattern) {
          Set<String> result = new TreeSet<String>();
          for (String key : keys()) {
              if (key.matches(pattern)) result.add(key);
          }
          return result;
      }
docs: Returns all keys matching the given pattern.
  
  @param pattern key pattern
  @return set of keys