public static Expression getExpressionForObject(Object source) {
        if (source == null) {
            return new NullLiteralExpr();
        }
        String className = source.getClass().getSimpleName();
        switch (className) {
            case "String":
                return new StringLiteralExpr((String) source);
            case "int":
            case "Integer":
                return new IntegerLiteralExpr((Integer) source);
            case "double":
            case "Double":
                return new DoubleLiteralExpr((Double) source);
            case "float":
            case "Float":
                return new DoubleLiteralExpr(((Float) source).doubleValue());
            case "boolean":
            case "Boolean":
                return new BooleanLiteralExpr((Boolean) source);
            default:
                return new NameExpr(source.toString());
        }
    }
@Test
    void getExpressionForObject() {
        String string = "string";
        Expression retrieved = CommonCodegenUtils.getExpressionForObject(string);
        assertThat(retrieved).isInstanceOf(StringLiteralExpr.class);
        assertThat(retrieved.toString()).isEqualTo("\"string\"");
        int i = 1;
        retrieved = CommonCodegenUtils.getExpressionForObject(i);
        assertThat(retrieved).isInstanceOf(IntegerLiteralExpr.class);
        assertThat(((IntegerLiteralExpr) retrieved).asInt()).isEqualTo(i);
        Integer j = 3;
        retrieved = CommonCodegenUtils.getExpressionForObject(j);
        assertThat(retrieved).isInstanceOf(IntegerLiteralExpr.class);
        assertThat(((IntegerLiteralExpr) retrieved).asInt()).isEqualTo(j.intValue());
        double x = 1.12;
        retrieved = CommonCodegenUtils.getExpressionForObject(x);
        assertThat(retrieved).isInstanceOf(DoubleLiteralExpr.class);
        assertThat(((DoubleLiteralExpr) retrieved).asDouble()).isCloseTo(x, Offset.offset(0.001));
        Double y = 3.12;
        retrieved = CommonCodegenUtils.getExpressionForObject(y);
        assertThat(retrieved).isInstanceOf(DoubleLiteralExpr.class);
        assertThat(((DoubleLiteralExpr) retrieved).asDouble()).isCloseTo(y, Offset.offset(0.001));
        float k = 1.12f;
        retrieved = CommonCodegenUtils.getExpressionForObject(k);
        assertThat(retrieved).isInstanceOf(DoubleLiteralExpr.class);
        assertThat(((DoubleLiteralExpr) retrieved).asDouble()).isCloseTo(1.12, Offset.offset(0.001));
        Float z = 3.12f;
        retrieved = CommonCodegenUtils.getExpressionForObject(z);
        assertThat(retrieved).isInstanceOf(DoubleLiteralExpr.class);
        assertThat(((DoubleLiteralExpr) retrieved).asDouble()).isCloseTo(z.doubleValue(), Offset.offset(0.001));
        boolean b = true;
        retrieved = CommonCodegenUtils.getExpressionForObject(b);
        assertThat(retrieved).isInstanceOf(BooleanLiteralExpr.class);
        assertThat(((BooleanLiteralExpr) retrieved).getValue()).isEqualTo(b);
        Boolean c = false;
        retrieved = CommonCodegenUtils.getExpressionForObject(c);
        assertThat(retrieved).isInstanceOf(BooleanLiteralExpr.class);
        assertThat(((BooleanLiteralExpr) retrieved).getValue()).isEqualTo(c);
    }