Here you can find the source of createList(Iterable
private static final List<Path> createList(Iterable<Path> dirs)
//package com.java2s; /*/*from w w w . ja v a2 s . com*/ * Copyright (c) 2012 Diamond Light Source Ltd. * * 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 */ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; public class Main { private static final List<Path> createList(Iterable<Path> dirs) { List<Path> ret = new ArrayList<Path>(3); for (Path path : dirs) { if (!Files.isReadable(path)) continue; ret.add(path); } return ret; } }