class MetadataSchemaPropertiesImpl implements MetadataProperties {

    protected final void collectMetadataProperty(final String fieldLabel, String propertyName, final Map<String, List<String>> metadata) {
        if (StringUtils.isNotBlank(fieldLabel) && StringUtils.isNotBlank(propertyName)) {

            propertyName = getRelativePropertyName(propertyName, metadata);

            if (metadata.containsKey(propertyName)) {
                final List<String> tmp = metadata.get(propertyName);
                if (!tmp.contains(fieldLabel)) {
                    tmp.add(fieldLabel);
                }
                metadata.put(propertyName, tmp);
            } else {
                final ArrayList<String> tmp = new ArrayList<>();
                if (StringUtils.isNotBlank(fieldLabel)) {
                    tmp.add(fieldLabel);
                }
                metadata.put(propertyName, tmp);
            }
        }
    }

}