List<String> (String name) { Object value = myEvaluationResult.myNamespace.get(name); if (value instanceof List valueList) { for (Object o : valueList) { if (o != null && !(o instanceof String)) { return Collections.emptyList(); } } return (List<String>)value; } if (value instanceof String) { return Collections.singletonList((String)value); } return Collections.emptyList(); }