<T>List<T> (@NotNull final PyExpression expression, @NotNull final Class<T> aClass) { final PyAnyExpressionEvaluator evaluator = new PyAnyExpressionEvaluator(true); final Object evaluate = evaluator.evaluate(expression); final T resultSingle = PyUtil.as(evaluate, aClass); if (resultSingle != null) { return Collections.singletonList(resultSingle); } return PyUtil.asList(PyUtil.as(evaluate, List.class), aClass); }