Here you can find the source of toPrimitive(Boolean[] array)
public static boolean[] toPrimitive(Boolean[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean[] toPrimitive(Boolean[] array) { boolean[] primitiveArray = new boolean[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; }// w ww .j av a 2s . c om return primitiveArray; } public static byte[] toPrimitive(Byte[] array) { byte[] primitiveArray = new byte[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; } return primitiveArray; } public static short[] toPrimitive(Short[] array) { short[] primitiveArray = new short[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; } return primitiveArray; } public static int[] toPrimitive(Integer[] array) { int[] primitiveArray = new int[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; } return primitiveArray; } public static long[] toPrimitive(Long[] array) { long[] primitiveArray = new long[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; } return primitiveArray; } public static float[] toPrimitive(Float[] array) { float[] primitiveArray = new float[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; } return primitiveArray; } public static double[] toPrimitive(Double[] array) { double[] primitiveArray = new double[array.length]; for (int i = 0; i < array.length; i++) { primitiveArray[i] = array[i]; } return primitiveArray; } }