DefaultStellarStatefulExecutor implements StellarStatefulExecutor, Serializable { @Override public <T> T execute(String expression, Map<String, Object> state, Class<T> clazz) { Object resultObject = execute(expression, state); T result = ConversionUtils.convert(resultObject, clazz); if (result == null) { throw new IllegalArgumentException(String.format("Unexpected type: expected=%s, actual=%s, expression=%s", clazz.getSimpleName(), ClassUtils.getShortClassName(resultObject,"null"), expression)); } return result; } DefaultStellarStatefulExecutor();  DefaultStellarStatefulExecutor(FunctionResolver functionResolver, Context context);  DefaultStellarStatefulExecutor(Map<String, Object> initialState); @Override Map<String, Object> getState(); @Override void assign(String variable, String expression, Map<String, Object> transientState); @Override void assign(String variable, Object value); @Override T execute(String expression, Map<String, Object> state, Class<T> clazz); @Override void clearState(); @Override void setContext(Context context); void setFunctionResolver(FunctionResolver functionResolver);  }
@Disabled @Test public void testExecutePredicate() { boolean actual = executor.execute("IS_INTEGER(2)", message, Boolean.class); assertThat(actual, equalTo(true)); }
@Test public void testExecuteWithWrongType() { assertThrows(RuntimeException.class, () -> executor.execute("2 + 2", message, Boolean.class)); }
@Test public void testExecuteWithTypeConversion() { executor.execute("2", message, Double.class); executor.execute("2", message, Float.class); executor.execute("2", message, Short.class); executor.execute("2", message, Long.class); }
@Test public void testExecuteTransformation() { String actual = executor.execute("TO_UPPER('lowercase')", message, String.class); assertThat(actual, equalTo("LOWERCASE")); }