code: private static Properties addJNDIProperties(Properties properties, String prefix, HashSet<String> specialProps) {
        Properties result = new Properties();
        for (Object property : properties.keySet()) {
           if (property instanceof String) {
              String s = (String) property;
              if (s.indexOf(prefix) > -1 && !specialProps.contains(s)) {
                 result.setProperty(s.substring(prefix.length()), properties.getProperty(s));
              }
           }
        }
        return result;
     }
docs: Creates a new {@code Properties} instance with all properties from {@code properties} which start with the given
  
  @param properties   the original properties
  @param prefix       the prefix indicating JNDI specific properties
  @param specialProps a set of property names to ignore
  @return Creates a new {@code Properties} instance with JNDI specific properties
  @{code prefix}. In the new instance the prefix is removed. If a property matches a value in {@code specialProps}
  it gets ignored.