public static Optional<AttributePath> determineCommonAttributePath(final ContentSchema contentSchema) {

		if (contentSchema.getKeyAttributePaths() == null && contentSchema.getValueAttributePath() == null) {

			return Optional.empty();
		}

		final Map<String, AttributePath> attributePaths = new HashMap<>();
		final Map<String, Attribute> attributes = new HashMap<>();

		if (contentSchema.getKeyAttributePaths() != null) {

			for (final AttributePath attributePath : contentSchema.getKeyAttributePaths()) {

				fillMaps(attributePath, attributePaths, attributes);
			}
		}

		if (contentSchema.getValueAttributePath() != null) {

			fillMaps(contentSchema.getValueAttributePath(), attributePaths, attributes);
		}

		final String commonPrefix = StringUtils.getCommonPrefix(attributePaths.keySet().toArray(new String[attributePaths.size()]));

		final String commonAttributePathString = cleanCommonPrefix(commonPrefix);

		if (attributePaths.containsKey(commonAttributePathString)) {

			return Optional.ofNullable(attributePaths.get(commonAttributePathString));
		}

		final String[] attributeURIs = commonAttributePathString.split(DMPStatics.ATTRIBUTE_DELIMITER.toString());

		final LinkedList<Attribute> apAttributes = new LinkedList<>();

		for (final String attributeURI : attributeURIs) {

			final Attribute attribute = attributes.get(attributeURI);
			apAttributes.add(attribute);
		}

		return Optional.of(new AttributePath(apAttributes));
	}