@Test
    void test() throws Exception {
        // we set up the 32 and 64 bit test cases. At this time,
        // the Tile format is not supported for floating-point samples by the
        // TIFF datareaders classes. So that format is not yet exercised.
        // Note also that the compressed floating-point with predictor=3
        // is processed in other tests, but not here.
        final File[] testFile = new File[8];
        testFile[0] = writeFile(32, ByteOrder.LITTLE_ENDIAN, false);
        testFile[1] = writeFile(64, ByteOrder.LITTLE_ENDIAN, false);
        testFile[2] = writeFile(32, ByteOrder.BIG_ENDIAN, false);
        testFile[3] = writeFile(64, ByteOrder.BIG_ENDIAN, false);
        testFile[4] = writeFile(32, ByteOrder.LITTLE_ENDIAN, true);
        testFile[5] = writeFile(64, ByteOrder.LITTLE_ENDIAN, true);
        testFile[6] = writeFile(32, ByteOrder.BIG_ENDIAN, true);
        testFile[7] = writeFile(64, ByteOrder.BIG_ENDIAN, true);
        for (int i = 0; i < testFile.length; i++) {
            final String name = testFile[i].getName();
            final ByteSource byteSource = ByteSource.file(testFile[i]);
            final TiffReader tiffReader = new TiffReader(true);
            final TiffContents contents = tiffReader.readDirectories(byteSource, true, // indicates that application should read image data, if present
                    FormatCompliance.getDefault());
            final TiffDirectory directory = contents.directories.get(0);
            final PhotometricInterpreterFloat pi = getPhotometricInterpreter();
            final TiffImagingParameters params = new TiffImagingParameters();
            params.setCustomPhotometricInterpreter(pi);
            final ByteOrder byteOrder = tiffReader.getByteOrder();
            final BufferedImage bImage = directory.getTiffImage(byteOrder, params);
            assertNotNull(bImage, "Failed to get image from " + name);
            final int[] pixel = new int[width * height];
            bImage.getRGB(0, 0, width, height, pixel, 0, width);
            for (int k = 0; k < pixel.length; k++) {
                assertEquals(argb[k], pixel[k], "Extracted data does not match original, test " + i + ", index " + k);
            }
            final float meanValue = pi.getMeanFound();
            assertEquals(0.5, meanValue, 1.0e-5, "Invalid numeric values in " + name);
            // To write out an image file for inspection, use the following
            // (with appropriate adjustments for path and OS)
            // File imFile = new File("C:/Users/public", testFile[i].getName() + ".png");
            // ImageIO.write(bImage, "PNG", imFile);

        }
    }
Constructs a photometric interpreter. This initialization is performed in a dedicated method to ensure consistency throughout different phases of the
test.

@return a valid instance.
src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java