svoid test_MountainsAndValleys { new MountainsAndValleys mav; mav.values(litdoublearray(1, 5, 3, 4, 5, 5, 2)); mav.run(); assertEqualsVerbose(ll(1, 4), mav.highs().asList()); assertEqualsVerbose(ll(0, 2, 6), mav.lows().asList()); assertEqualsVerbose(1, mav.next(mav.highs, 0)); assertEqualsVerbose(4, mav.next(mav.highs, 01); assertEqualsVerbose(-1, mav.next(mav.highs, 4)); assertEqualsVerbose(-1, mav.prev(mav.lows, 0)); assertEqualsVerbose(0, mav.prev(mav.lows, 1)); assertEqualsVerbose(0, mav.prev(mav.lows, 2)); assertEqualsVerbose(2, mav.prev(mav.lows, 3)); assertEqualsVerbose(2, mav.prev(mav.lows, 4)); }