ImagePair { public boolean isExpectedMoved() { switch (sizeRelationType) { case 1: return false; case 2: return true; case 3: if (offset.getX() > 0) return true; else return false; case 4: if (offset.getX() > 0) return false; else return true; default: return false; } } 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 testIsExpectedMoved() 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(); boolean actual = imagePair.isExpectedMoved(); assertThat(actual, is(false)); }