class ChangesHistory {

    public void addHistory(JsonNode unitBeforeUpdate, JsonNode unitAfterUpdate) {
        final JsonNode objectToHistory = JsonHandler.findNode(unitBeforeUpdate, objectPathForHistory);

        final JsonNode historyNode = unitAfterUpdate.findPath(History._HISTORY);
        final History history = new History(objectPathForHistory, getUnitVersion(unitBeforeUpdate), objectToHistory);

        if (historyNode.isMissingNode()) {
            ((ObjectNode) unitAfterUpdate).set(History._HISTORY, history.getArrayNode());
        } else {
            ((ArrayNode) historyNode).add(history.getNode());
        }
    }

    public  ChangesHistory(String objectPathForHistory);

}