Here you can find the source of getArrays(Object parent, Collection collection)
public static Object[] getArrays(Object parent, Collection collection)
//package com.java2s; /******************************************************************************* * Copyright (c) 2008 Sybase, Inc.//from ww w .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: Sybase - initial API and implementation ******************************************************************************/ import java.util.Collection; public class Main { private static final Object[] EMPTY_ELEMENT_ARRAY = new Object[0]; public static Object[] getArrays(Object parent, Collection collection) { if (collection.isEmpty()) { return EMPTY_ELEMENT_ARRAY; } else { // if (parent instanceof IVirtualNode && !((IVirtualNode) parent).hasChildren()) // { // ((IVirtualNode) parent).addChildren(collection); // } // return collection.toArray(new Object[collection.size()]); return collection.toArray(); } } }