code: @SuppressWarnings("unchecked")
    public static void checkProperties(Properties properties, Properties defaults) {
      Set<String> names = Generics.newHashSet();
      for (Enumeration<String> e = (Enumeration<String>) properties.propertyNames();
           e.hasMoreElements(); ) {
        names.add(e.nextElement());
      }
      for (Enumeration<String> e = (Enumeration<String>) defaults.propertyNames();
           e.hasMoreElements(); ) {
        names.remove(e.nextElement());
      }
      if (!names.isEmpty()) {
        if (names.size() == 1) {
          throw new IllegalArgumentException("Unknown property: " + names.iterator().next());
        } else {
          throw new IllegalArgumentException("Unknown properties: " + names);
        }
      }
    }
docs: Checks to make sure that all properties specified in <code>properties</code>
  are known to the program by checking that each simply overrides
  a default value
  @param properties Current properties
  @param defaults Default properties which lists all known keys