@Test
    void testBadCoordinates() {
        final float[] f = new float[100];
        final AbstractTiffRasterData instance = new TiffRasterDataFloat(10, 10, 1, f);
        assertThrows(IllegalArgumentException.class, () -> instance.getValue(11, 11), "Access method getValue() did not detect bad coordinates");
        assertThrows(IllegalArgumentException.class, () -> instance.setValue(11, 11, 5.0f), "Access method setValue() did not detect bad coordinates");
        assertThrows(IllegalArgumentException.class, () -> instance.getValue(1, 1, 2), "Access method setValue() did not detect bad sample index");
    }
Test of access with bad coordinates, of class TiffRasterData.
src/test/java/org/apache/commons/imaging/formats/tiff/TiffRasterDataTest.java