class NestedMetadata {

  static ObjectNode userAgentFromAttributes(Map<String, String> attributes) {
    ObjectNode userAgent = Json.createObjectNode();
    attributes.entrySet().stream() //
        .filter(entry -> entry.getKey().startsWith(USER_AGENT_PREFIX)) //
        .forEach(entry -> userAgent.put(entry.getKey().substring(USER_AGENT_PREFIX.length()),
            entry.getValue()));
    return userAgent;
  }

  private  NestedMetadata();

}