### Question:
SimpleExpressionEvaluator implements ExpressionEvaluator { @Override public <T> T evaluate( String expression, Class<T> type ) throws EvaluationException { if ( expression == null ) { throw new EvaluationException( "Cannot evaluate null as an expression " ); } if ( type == null ) { throw new EvaluationException( "Cannot evaluate to type null" ); } return cast( map( evaluator.evaluate( expression ) ), type ); }  @Override T evaluate( String expression, Class<T> type );  }### Answer:
@Test void shouldConvertToSpecificType() throws EvaluationException { ExpressionEvaluator evaluator = Evaluator.expressionEvaluator(); List<?> list = evaluator.evaluate( "[1, 2, 3]", List.class ); assertEquals( asList( 1L, 2L, 3L ), list ); }
@Test void shouldThrowIfWrongType() { ExpressionEvaluator evaluator = Evaluator.expressionEvaluator(); assertThrows( EvaluationException.class, () -> evaluator.evaluate( "{prop: 42}", List.class ) ); }