code: public static Properties extractPropertiesWithPrefix(Properties properties, Optional<String> prefix) {
      Preconditions.checkNotNull(properties);
      Preconditions.checkNotNull(prefix);
  
      Properties extractedProperties = new Properties();
      for (Map.Entry<Object, Object> entry : properties.entrySet()) {
        if (StringUtils.startsWith(entry.getKey().toString(), prefix.or(StringUtils.EMPTY))) {
          extractedProperties.put(entry.getKey().toString(), entry.getValue());
        }
      }
  
      return extractedProperties;
    }
docs: Extract all the keys that start with a <code>prefix</code> in {@link Properties} to a new {@link Properties}
  instance.
  
  @param properties the given {@link Properties} instance
  @param prefix of keys to be extracted
  @return a {@link Properties} instance