class AbstractGraphTemplate implements GraphTemplate {

    @Override
    public <T> T update(T entity) {
        requireNonNull(entity, "entity is required");
        checkId(entity);
        if (isIdNull(entity)) {
            throw new NullPointerException("to update a graph id cannot be null");
        }
        getVertex(entity).orElseThrow(() -> new EntityNotFoundException("Entity does not find in the update"));

        UnaryOperator<Vertex> update = e -> getConverter().toVertex(entity);
        return getFlow().flow(entity, update);
    }

}