@Test
    void testBadConstructor() {
        assertThrows(IllegalArgumentException.class, () -> new TiffRasterDataFloat(-1, 10), "Constructor did not detect bad width");
        assertThrows(IllegalArgumentException.class, () -> new TiffRasterDataFloat(10, -1), "Constructor did not detect bad height");
        assertThrows(IllegalArgumentException.class, () -> new TiffRasterDataFloat(1, 1, 0), "Constructor did not detect bad samplesPerPixel");

        final float[] f = new float[10];
        assertThrows(IllegalArgumentException.class, () -> new TiffRasterDataFloat(2, 10, f), "Constructor did not detect insufficient input array size");
        assertThrows(IllegalArgumentException.class, () -> new TiffRasterDataFloat(2, 3, 2, f), "Constructor did not detect insufficient input array size");
    }
Test of constructors with bad arguments, of class TiffRasterData.
src/test/java/org/apache/commons/imaging/formats/tiff/TiffRasterDataTest.java