class MetadataDocumentHelper {

    public static String getStrategyIdFromRawUnitOrGot(JsonNode documentJson) {
        if (documentJson == null || !documentJson.isObject()) {
            throw new IllegalArgumentException("Expected object json");
        }
        ObjectNode document = (ObjectNode) documentJson;
        if (!document.has(STORAGE_KEY) || !document.get(STORAGE_KEY).has(STRATEGY_KEY)
                || !document.get(STORAGE_KEY).get(STRATEGY_KEY).isTextual()) {
            throw new IllegalArgumentException("Expected storage/strategy information in MD document");
        }
        return document.get(STORAGE_KEY).get(STRATEGY_KEY).asText();
    }

}