ImageLayout2 extends ImageLayout { @Override public int hashCode() { int code = 0, i = 1; if (isValid(ImageLayout2.WIDTH_MASK)){ code += (getWidth(null) * i++); } if (isValid(ImageLayout2.HEIGHT_MASK)){ code += (getHeight(null) * i++); } if (isValid(ImageLayout2.MIN_X_MASK)){ code += (getMinX(null) * i++); } if (isValid(ImageLayout2.MIN_Y_MASK)){ code += (getMinY(null) * i++); } if (isValid(ImageLayout2.TILE_HEIGHT_MASK)){ code += (getTileHeight(null) * i++); } if (isValid(ImageLayout2.TILE_WIDTH_MASK)){ code += (getTileWidth(null) * i++); } if (isValid(ImageLayout2.TILE_GRID_X_OFFSET_MASK)){ code += (getTileGridXOffset(null) * i++); } if (isValid(ImageLayout2.TILE_GRID_Y_OFFSET_MASK)){ code += (getTileGridYOffset(null) * i++); } if (isValid(ImageLayout2.SAMPLE_MODEL_MASK)){ code ^= getSampleModel(null).hashCode(); } code ^= validMask; if (isValid(ImageLayout2.COLOR_MODEL_MASK)) code ^= getColorModel(null).hashCode(); return code; } ImageLayout2();  ImageLayout2(
            final int minX, 
            final int minY, 
            final int width, 
            final int height, 
            final int tileGridXOffset,
            final int tileGridYOffset, 
            final int tileWidth, 
            final int tileHeight, 
            final SampleModel sampleModel,
            final ColorModel colorModel);  ImageLayout2(
            final int tileGridXOffset, 
            final int tileGridYOffset, 
            final int tileWidth, 
            final int tileHeight,
            final SampleModel sampleModel, 
            final ColorModel colorModel);  ImageLayout2(
            final int minX, 
            final int minY, 
            final int width, 
            final int height);  ImageLayout2(RenderedImage im); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void nilHash() { ImageLayout2 il = new ImageLayout2(); assertEquals(0, il.hashCode()); }
@Test public void sameHash() { ImageLayout2 il1 = new ImageLayout2(1, 2, 3, 4, 5, 6, 7, 8, null, null); ImageLayout2 il2 = new ImageLayout2(1, 2, 3, 4, 5, 6, 7, 8, null, null); assertEquals(il1.hashCode(), il2.hashCode()); }