Here you can find the source of getArrayList(Map map, Object obj)
public static ArrayList getArrayList(Map map, Object obj)
//package com.java2s; /******************************************************************************* * Copyright (c) 2007, 2008 Intel Corporation and others. * 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:/*from ww w . j a v a 2 s .c o m*/ * Intel Corporation - Initial API and implementation *******************************************************************************/ import java.util.ArrayList; import java.util.Map; public class Main { public static ArrayList getArrayList(Map map, Object obj) { ArrayList list = (ArrayList) map.get(obj); if (list == null) { list = new ArrayList(); map.put(obj, list); } return list; } }