XValue (Collection<? extends XValue> vars, String name) { StringBuilder names = new StringBuilder(); for (XValue each : vars) { if (each instanceof XNamedValue) { String eachName = ((XNamedValue)each).getName(); if (eachName.equals(name)) return each; if (!names.isEmpty()) names.append(", "); names.append(eachName); } } throw new AssertionError("var '" + name + "' not found among " + names); }