code: private static Map<String, Object> extractPropertiesForBranch(
        Properties properties, String prefix, String branchSuffix) {
  
      Map<String, Object> ret = new HashMap<>();
  
      for (Map.Entry<Object, Object> prop: properties.entrySet()) {
        String key = (String)prop.getKey();
        if (key.startsWith(prefix) && (branchSuffix.length() == 0 || key.endsWith(branchSuffix))) {
          int strippedKeyStart = Math.min(key.length(), prefix.length() + 1);
  
          // filter out subkeys that don't have a '.' -- eg writer.encrypted.foo shouldn't be returned
          // if prefix is writer.encrypt
          if (strippedKeyStart != key.length() && key.charAt(strippedKeyStart - 1) != '.') {
            continue;
          }
  
          int strippedKeyEnd = Math.max(strippedKeyStart, key.length() - branchSuffix.length());
          String strippedKey = key.substring(strippedKeyStart, strippedKeyEnd);
          ret.put(strippedKey, prop.getValue());
        }
      }
  
      return ret;
    }
docs: Extract a set of properties for a given branch, stripping out the prefix and branch
  suffix.
  
  Eg - original output:
  writer.encrypt.1 -> foo
  writer.encrypt.something.1 -> bar
  
  will transform to
  
  "" -> foo
  something - bar
  this is very similar to ConfigUtils and typesafe config; need to figure out config story
  @param properties Properties to extract data from
  @param prefix Prefix to match; all other properties will be ignored
  @param branchSuffix Suffix for all config properties
  @return Transformed properties as described above