private static boolean nextCombination(final int[] sequence, final int max) {
        int i;
        for (i = 0; i < sequence.length; i++) {
            if (sequence[i] != max) {
                sequence[i]++;
                break;
            }
            sequence[i] = 0;
        }
        return i < sequence.length;
    }
Generates the next combination of elements in the sequence array, with each element having a maximum value of max. Initially, the sequence should be set
to minimum values of each element.

@param sequence the array of elements to update
@param max      the maximum value of each element in the sequence
@return false if there is no more combinations (ie. nothing was done), true otherwise
src/test/java/org/apache/commons/imaging/formats/tiff/TiffCcittTest.java