static A assertAllElementsAreOfType(Class type, A l) { if (l != null) for (O x : l) if (!isInstanceOrNull(type, x)) fail("Element " + className(x) + " not of type " + type); ret l; }