Here you can find the source of asBooleanArray(Collection
public static boolean[] asBooleanArray(Collection<Boolean> collection)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by import java.util.Collection; import java.util.Iterator; public class Main { public static boolean[] asBooleanArray(Collection<Boolean> collection) { boolean[] array = new boolean[collection.size()]; Iterator<Boolean> iterator = collection.iterator(); int i = 0; while (iterator.hasNext()) { array[i++] = iterator.next(); }/*w w w. java 2s . co m*/ return array; } }