Update SinglePeakFinderUnitTest.java
This commit is contained in:
parent
16b8708d25
commit
2f18d71810
|
@ -21,4 +21,12 @@ public class SinglePeakFinderUnitTest {
|
||||||
OptionalInt peak = SinglePeakFinder.findSinglePeak(arr);
|
OptionalInt peak = SinglePeakFinder.findSinglePeak(arr);
|
||||||
assertTrue(peak.isEmpty());
|
assertTrue(peak.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void findSinglePeak_givenEqualElementArray_thenReturnsCorrectPeak() {
|
||||||
|
int[] arr = {-2, -2, -2, -2, -2};
|
||||||
|
OptionalInt peak = SinglePeakFinder.findSinglePeak(arr);
|
||||||
|
assertTrue(peak.isPresent());
|
||||||
|
assertEquals(-2, peak.getAsInt());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue