diff --git a/modules/objdetect/misc/java/test/QRCodeDetectorTest.java b/modules/objdetect/misc/java/test/QRCodeDetectorTest.java index cd8be409aa..369e7b8cc3 100644 --- a/modules/objdetect/misc/java/test/QRCodeDetectorTest.java +++ b/modules/objdetect/misc/java/test/QRCodeDetectorTest.java @@ -5,7 +5,10 @@ import org.opencv.core.Mat; import org.opencv.objdetect.QRCodeDetector; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.test.OpenCVTestCase; +import java.util.Arrays; import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; public class QRCodeDetectorTest extends OpenCVTestCase { @@ -39,11 +42,7 @@ public class QRCodeDetectorTest extends OpenCVTestCase { boolean result = detector.detectAndDecodeMulti(img, output); assertTrue(result); assertEquals(output.size(), 6); - assertEquals(output.get(0), "SKIP"); - assertEquals(output.get(1), "EXTRA"); - assertEquals(output.get(2), "TWO STEPS FORWARD"); - assertEquals(output.get(3), "STEP BACK"); - assertEquals(output.get(4), "QUESTION"); - assertEquals(output.get(5), "STEP FORWARD"); + List < String > expectedResults = Arrays.asList("SKIP", "EXTRA", "TWO STEPS FORWARD", "STEP BACK", "QUESTION", "STEP FORWARD"); + assertEquals(new HashSet(output), new HashSet(expectedResults)); } }