code: public static Properties getFilteredProperties (final Properties source, String prefix)
      {
          final String dprefix = prefix + ".";
          return new Properties() {
              @Override public String getProperty (String key) {
                  return getProperty(key, null);
              }
              @Override public String getProperty (String key, String defaultValue) {
                  return source.getProperty(dprefix + key, source.getProperty(key, defaultValue));
              }
              @Override public Enumeration<?> propertyNames () {
                  return new Enumeration<Object>() {
                      public boolean hasMoreElements () {
                          return next != null;
                      }
                      public Object nextElement () {
                          Object onext = next;
                          next = findNext();
                          return onext;
                      }
                      protected Object findNext () {
                          while (senum.hasMoreElements()) {
                              String name = (String)senum.nextElement();
                              if (!name.startsWith(dprefix)) {
                                  return name;
                              }
                              name = name.substring(dprefix.length());
                              if (!source.containsKey(name)) {
                                  return name;
                              }
                          }
                          return null;
                      }
                      protected Enumeration<?> senum = source.propertyNames();
                      protected Object next = findNext();
                  };
              }
          };
      }
docs: Returns a filtered version of the specified properties that first looks for a property
  starting with the given prefix, then looks for a property without the prefix. For example,
  passing the prefix "alt" and using the following properties:
  
  <pre>
  alt.texture = sand.png
  lighting = off
  </pre>
  
  ...would return "sand.png" for the property "texture" and "off" for the property "lighting".
  Unlike {@link #getSubProperties}, the object returned by this method references, rather than
  copies, the underlying properties. Only the {@link Properties#getProperty} methods are
  guaranteed to work correctly on the returned object.