From dd251d2d331eb2044bcd2ec69bfb5da92985590d Mon Sep 17 00:00:00 2001 From: Imran Alam <75203259+Imranalam28@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:02:28 +0530 Subject: [PATCH] Update PeakElementFinderUnitTest.java --- .../com/baeldung/peakelements/PeakElementFinderUnitTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core-java-modules/core-java-collections-array-list-2/src/test/java/com/baeldung/peakelements/PeakElementFinderUnitTest.java b/core-java-modules/core-java-collections-array-list-2/src/test/java/com/baeldung/peakelements/PeakElementFinderUnitTest.java index 9cd33d8aa0..8eab2d386f 100644 --- a/core-java-modules/core-java-collections-array-list-2/src/test/java/com/baeldung/peakelements/PeakElementFinderUnitTest.java +++ b/core-java-modules/core-java-collections-array-list-2/src/test/java/com/baeldung/peakelements/PeakElementFinderUnitTest.java @@ -14,6 +14,8 @@ public class PeakElementFinderUnitTest { int[] array = {5, 8, 7, 6, 12}; List peaks = finder.findPeakElements(array); assertEquals(2, peaks.size()); + assertTrue(peaks.contains(8)); + assertTrue(peaks.contains(12)); } @Test @@ -22,6 +24,8 @@ public class PeakElementFinderUnitTest { int[] array = {5, 2, 1, 3, 4}; List peaks = finder.findPeakElements(array); assertEquals(2, peaks.size()); + assertTrue(peaks.contains(5)); + assertTrue(peaks.contains(4)); } @Test @@ -30,5 +34,6 @@ public class PeakElementFinderUnitTest { int[] array = {1, 2, 2, 2, 3, 4, 5}; List peaks = finder.findPeakElements(array); assertEquals(1, peaks.size()); + assertTrue(peaks.contains(5)); } }