ImagePair { public Offset getDominantOffset() { return offset; } ImagePair(BufferedImage expectedImage, BufferedImage actualImage); void compareImagePairAll(); void prepare(); void doCategorize(); List<ComparedRectangleArea> getComparedRectangles(); double getEntireSimilarity(); double getMinSimilarity(); Offset getDominantOffset(); boolean isExpectedMoved();  }
@Test public void testGetDominantOffset() throws Exception { BufferedImage expectedImage = ImageIO.read(getClass().getResource("ImagePairTest_missing_expected.png")); BufferedImage targetImage = ImageIO.read(getClass().getResource("ImagePairTest_missing_actual.png")); ImagePair imagePair = new ImagePair(expectedImage, targetImage); imagePair.compareImagePairAll(); Offset expected = new Offset(0, 0); Offset actual = imagePair.getDominantOffset(); assertThat(actual.getX(), is(expected.getX())); assertThat(actual.getY(), is(expected.getY())); }