public static String printBooleanArray(boolean[] array) {
        if (array==null || array.length==0) {
            return "empty";
        } else {
            String s = "" + (array[0]?"1":"0");
            for (int i=1; i<array.length; i++) {
                s += array[i]?"\t1":"\t0";
            }
            return s;
        }
    }