Java tutorial
//package com.java2s; /** * <copyright> * Copyright (c) 2010-2012 Henshin developers. All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 which * accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * </copyright> */ public class Main { public static boolean allInstancesOf(Class<?> clazz, Object... args) { for (Object arg : args) if (!clazz.isInstance(arg)) return false; return true; } }