public static void appendAttributes(final AttributeMap attributeMap,
                                        final StringBuilder builder,
                                        final String... attributeKeys) {

        if (builder != null && attributeMap != null && attributeKeys != null) {

            final String attributesStr = Arrays.stream(attributeKeys)
                    .map(key ->
                            getAttributeStr(attributeMap, key))
                    .filter(Objects::nonNull)
                    .collect(Collectors.joining(", "));

            if (!attributesStr.isBlank()) {
                builder.append(" [")
                        .append(attributesStr)
                        .append("]");
            }
        }
    }
For when you just want the value for one or more keys.
Saves having to de-serialise the whole file to an {@link AttributeMap}.

@param path The file to extract values from.
@param keys The keys to find values for. Assumed to be already trimmed.
@return A list of values using the same indexing as the supplied keys. The length of the
returned list will always match that of the supplied keys list.
stroom-meta/stroom-meta-api/src/main/java/stroom/meta/api/AttributeMapUtil.java