Assert { public static void areInstances(Collection<?> objects, String name, Class<?>... classes) { if (objects != null) { for (Object object : objects) { isInstance(object, name, classes); } } } private  Assert(); static void notNull(Object param, String paramName); static void validXMLChars(String s, String paramName); static void isNmtoken(String token, String paramName); static void xliffAttrAvailable(Element elem, String... attrNames); static void xliffAttrRestricted(Element elem,
			boolean nonXliffAllowed, boolean xmlSpaceAllowed,
			boolean xmlLangAllowed, String... xliffAttrNames); static void isXliffElement(org.w3c.dom.Node node); static void isXliffElement(org.w3c.dom.Node node, String name); static void isElement(Node node); static void isNonXliffElement(org.w3c.dom.Node node); static void isInstance(Object object, String name,
			Class<?>... classes); static void areInstances(Collection<?> objects, String name,
			Class<?>... classes);  }
@Test public void testAreInstances() { ArrayList<Object> objects = new ArrayList<Object>(); objects.add(new Integer(5)); objects.add(new Double(3.0)); Assert.areInstances(objects, "objects", Integer.class, Double.class); Assert.areInstances(objects, "objects", Object.class); try { Assert.areInstances(objects, "objects", Double.class); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } }