class EntityTagBuilder {

    static Optional<EntityTag> buildFromEntity(@Nullable final Object entity) {
        if (entity == null) {
            return Optional.empty();
        }

        if (entity instanceof Entity) {
            return buildForTopLevelEntity((Entity<? extends Revision>) entity);
        } else {
            return buildForSubEntity(entity);
        }
    }

    private  EntityTagBuilder();

}