class MetadataDocumentHelper {

    public static String getStrategyIdFromUnit(JsonNode unitJson) {
        if (unitJson == null || !unitJson.isObject()) {
            throw new IllegalArgumentException("Expected unit object json");
        }
        ObjectNode unit = (ObjectNode) unitJson;
        if (!unit.has(VitamFieldsHelper.storage()) || !unit.get(VitamFieldsHelper.storage()).has(STRATEGY_KEY)
                || !unit.get(VitamFieldsHelper.storage()).get(STRATEGY_KEY).isTextual()) {
            throw new IllegalArgumentException("Expected storage/strategy information in unit");
        }
        return unit.get(VitamFieldsHelper.storage()).get(STRATEGY_KEY).asText();
    }

}