presto-parser/src/main/java/io/prestosql/sql/parser/AstBuilder.java/AstBuilder/visitIfPresent
class AstBuilder:    private <T> Optional<T> visitIfPresent(ParserRuleContext context, Class<T> clazz)
    {
        return Optional.ofNullable(context)
                .map(this::visit)
                .map(clazz::cast);
    }