@Override
    public Object evaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses) {
        Object expressionResult = compileAndExecute(rawExpression, new HashMap<>());
        Class<Object> requiredClass = loadClass(className, classLoader);
        if (expressionResult != null && !requiredClass.isAssignableFrom(expressionResult.getClass())) {
            throw new IllegalArgumentException("Cannot assign a '" + expressionResult.getClass().getCanonicalName() +
                                                       "' to '" + requiredClass.getCanonicalName() + "'");
        }
        return expressionResult;
    }
@Test
    public void evaluateLiteralExpression_many() {
        assertThat(evaluateLiteralExpression("1", Integer.class)).isEqualTo(1);

        assertThat(evaluateLiteralExpression("\"Value\"", String.class)).isEqualTo("Value");

        assertThat(evaluateLiteralExpression("2 * 3", Integer.class)).isEqualTo(6);

        assertThat(evaluateLiteralExpression("-1 + (3 * 5)", Integer.class)).isEqualTo(14);

        assertThat(evaluateLiteralExpression("[\"Jim\"]", ArrayList.class)).isEqualTo(List.of("Jim"));

        assertThat(evaluateLiteralExpression("[]", ArrayList.class)).isEqualTo(List.of());

        assertThat(evaluateLiteralExpression("\"abc..\"[2]", Character.class)).isEqualTo('c');

        assertThat(evaluateLiteralExpression("1.234B", BigDecimal.class)).isEqualTo(new BigDecimal("1.234"));

        assertThat(evaluateLiteralExpression("1.234d", Double.class)).isEqualTo(Double.valueOf("1.234"));

        assertThat(evaluateLiteralExpression("\"Value\"", String.class)).isEqualTo("Value");

        assertThat(evaluateLiteralExpression("a = 1; b = 2; a+b;", Integer.class)).isEqualTo(3);

        assertThat(evaluateLiteralExpression("a = \"Te\"; b = \"st\"; a+b;", String.class)).isEqualTo("Test");

        assertThatThrownBy(() -> evaluateLiteralExpression("a = 1 b = 2 a+b;", Integer.class))
                .isInstanceOf(CompileException.class);

        assertThatThrownBy(() -> evaluateLiteralExpression("a = 1; a+b;", Integer.class))
                .isInstanceOf(CompileException.class);

        assertThat(evaluateLiteralExpression("a = \"Bob\";\n" +
                "test = new java.util.ArrayList();\n" +
                "test.add(a);\n" +
                "test.add(\"Michael\");\n" +
                "test;",
                ArrayList.class)).isEqualTo(List.of("Bob", "Michael"));

        Map<String, String> expectedMap = Map.of("Jim", "Person");

        assertThat(evaluateLiteralExpression("[\"Jim\" : \"Person\"]", HashMap.class)).isEqualTo(expectedMap);
        
        assertThat(evaluateLiteralExpression("a = \"Person\";\n" +
                "test = new java.util.HashMap();\n" +
                "test.put(\"Jim\", a);\n" +
                "test;",
                HashMap.class)).isEqualTo(expectedMap);
        
        assertThat(evaluateLiteralExpression("a = \"Person\";test = new java.util.HashMap();test.put(\"Jim\", a);test;", HashMap.class)).isEqualTo(expectedMap);
        
        assertThat(evaluateLiteralExpression("a = \"Person\";\n" +
                        "test = new java.util.HashMap();\n" +
                        "test.put(\"Jim\", a);\n" +
                        "test;\n" +
                        "test.clear();\n" +
                        "test;",
                HashMap.class)).isEqualTo(Map.of());

        assertThatThrownBy(() -> evaluateLiteralExpression("1+", String.class)).isInstanceOf(RuntimeException.class);

        assertThatThrownBy(() -> evaluateLiteralExpression("1", String.class))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessageStartingWith("Cannot assign a 'java.lang.Integer");
    }