@Test
    void testAll5x2Compressions() {
        final byte[] uncompressed = new byte[2];
        final int[] combinations = new int[10];
        do {
            for (int x = 0; x < 5; x++) {
                if (combinations[x] != 0) {
                    uncompressed[0] |= 0x80 >>> x;
                }
            }
            for (int x = 0; x < 5; x++) {
                if (combinations[5 + x] != 0) {
                    uncompressed[1] |= 0x80 >>> x;
                }
            }

            try {
                final byte[] compressed = T4AndT6Compression.compressModifiedHuffman(uncompressed, 5, 2);
                final byte[] result = T4AndT6Compression.decompressModifiedHuffman(compressed, 5, 2);
                assertEquals(uncompressed.length, result.length);
                for (int i = 0; i < uncompressed.length; i++) {
                    assertEquals(uncompressed[i], result[i]);
                }
            } catch (final ImagingException ex) {
                Debug.debug(ex);
                fail();
            }

            try {
                final byte[] compressed = T4AndT6Compression.compressT4_1D(uncompressed, 5, 2, true);
                final byte[] result = T4AndT6Compression.decompressT4_1D(compressed, 5, 2, true);
                assertEquals(uncompressed.length, result.length);
                for (int i = 0; i < uncompressed.length; i++) {
                    assertEquals(uncompressed[i], result[i]);
                }
            } catch (final ImagingException ex) {
                Debug.debug(ex);
                fail();
            }

            try {
                final byte[] compressed = T4AndT6Compression.compressT4_1D(uncompressed, 5, 2, false);
                final byte[] result = T4AndT6Compression.decompressT4_1D(compressed, 5, 2, false);
                assertEquals(uncompressed.length, result.length);
                for (int i = 0; i < uncompressed.length; i++) {
                    assertEquals(uncompressed[i], result[i]);
                }
            } catch (final ImagingException ex) {
                Debug.debug(ex);
                fail();
            }

            try {
                final byte[] compressed = T4AndT6Compression.compressT4_2D(uncompressed, 5, 2, true, 2);
                final byte[] result = T4AndT6Compression.decompressT4_2D(compressed, 5, 2, true);
                assertEquals(uncompressed.length, result.length);
                for (int i = 0; i < uncompressed.length; i++) {
                    assertEquals(uncompressed[i], result[i]);
                }
            } catch (final ImagingException ex) {
                Debug.debug(ex);
                fail();
            }

            try {
                final byte[] compressed = T4AndT6Compression.compressT4_2D(uncompressed, 5, 2, false, 2);
                final byte[] result = T4AndT6Compression.decompressT4_2D(compressed, 5, 2, false);
                assertEquals(uncompressed.length, result.length);
                for (int i = 0; i < uncompressed.length; i++) {
                    assertEquals(uncompressed[i], result[i]);
                }
            } catch (final ImagingException ex) {
                Debug.debug(ex);
                fail();
            }

            try {
                final byte[] compressed = T4AndT6Compression.compressT6(uncompressed, 5, 2);
                final byte[] result = T4AndT6Compression.decompressT6(compressed, 5, 2);
                assertEquals(uncompressed.length, result.length);
                for (int i = 0; i < uncompressed.length; i++) {
                    assertEquals(uncompressed[i], result[i]);
                }
            } catch (final ImagingException ex) {
                Debug.debug(ex);
                fail();
            }
        } while (nextCombination(combinations, 1));
    }
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