Here you can find the source of addCheck(Collection c, Object o)
@SuppressWarnings("unchecked") private static void addCheck(Collection c, Object o)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Google, Inc./* w ww. ja v a2 s .c om*/ * 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 * * Contributors: * Google, Inc. - initial API and implementation *******************************************************************************/ import java.util.Collection; public class Main { @SuppressWarnings("unchecked") private static void addCheck(Collection dest, Collection src) { /* add object to collection if non-null */ if (src.size() > 0) { // Iterator iter = src.iterator(); // while (iter.hasNext()) { // dest.addAll(getWidgets((Widget)iter.next())); // } dest.addAll(src); } } @SuppressWarnings("unchecked") private static void addCheck(Collection c, Object o) { /* add object to collection if non-null */ if (o != null) { c.add(o); // c.addAll(getWidgets((Widget)o)); } } }