Google Guava is a java library with lot of utilities and reusable components. This requires the library guava-10.0.jar to be in classpath. The following example shows using Booleans.asList() API.
package com.bethecoder.tutorials.guava.primitive_tests; import java.util.List; import com.google.common.primitives.Booleans; public class BooleanListTest { /** * @param args */ public static void main(String[] args) { List<Boolean> boolList = Booleans.asList(true, false, false, true); System.out.println(boolList); } }
[true, false, false, true]