import org.thymeleaf.standard.expression.*; import java.lang.reflect.*; public class TestEach { public static void main(String[] args) throws Exception { String[] exprs = { "mod : ${modules}", "x : ${modules}", "m : ${modules}", "card : ${modules}", "mod : ${items}", "module : ${modules}", "mod2 : ${modules}", }; Method m = EachUtils.class.getDeclaredMethod("internalParseEach", String.class); m.setAccessible(true); for (String e : exprs) { try { Object each = m.invoke(null, e); System.out.println("OK : " + e + " -> " + each); } catch (InvocationTargetException ex) { System.out.println("FAIL : " + e + " -> " + ex.getCause()); } } } }