void executeBadBounds(final ImageBuilder imageBuilder, final int x, final int y, final int w, final int h) {
        try {
            final ImageBuilder sub = imageBuilder.getSubset(x, y, w, h);
            fail("Failed to detect bad bounds " + x + ", " + y + ", " + w + ", " + h);
        } catch (final RasterFormatException rfe) {
            // success, no action required
        }
    }
Provides unit tests for the ImageBuilder class.
src/test/java/org/apache/commons/imaging/common/ImageBuilderTest.java