Assert { public static void isInstance(Object object, String name, Class<?>... classes) { if (object == null) { return; } for (Class<?> clazz : classes) { if (clazz.isInstance(object)) { return; } } String msg = MessageFormat .format( "Parameter ''{0}'' is not an instance of a class of this implementation", name); throw new IllegalArgumentException(msg); } 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 testIsInstance() { Integer anInteger = new Integer(5); Assert.isInstance(null, "anInteger", Integer.class); Assert.isInstance(anInteger, "anInteger", Object.class); Assert.isInstance(anInteger, "anInteger", Integer.class); try { Assert.isInstance(anInteger, "anInteger", Double.class); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } }