Here you can find the source of instanceOfAll(Object o, Class>... clazzes)
public static boolean instanceOfAll(Object o, Class<?>... clazzes)
//package com.java2s; /**//from w w w .java 2 s.co m * <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 instanceOfAll(Object o, Class<?>... clazzes) { for (Class<?> clazz : clazzes) if (!clazz.isInstance(o)) return false; return true; } }