class MathHelper {

    public static <T> Collection<List<T>> computeAllCombinations(T[] items) {

        // create bitvector (all bit combinations other than all zeros)
        int bits = items.length;
        List<List<T>> combinations = new ArrayList<List<T>>();

        int max = (int) Math.pow(2, bits);
        for (long i = 1; i < max; i++) {
            List<T> combination = new LinkedList<T>();
            if (computeCombinationRecursive(i, items, combination, 0)) {
                combinations.add(combination);
            }
        }

        return combinations;
    }

    private  MathHelper();

}