### Question:
PrimitiveLongPeekingIterator extends PrimitiveLongCollections.PrimitiveLongBaseIterator { public boolean hasMultipleValues() { return hasMultipleValues; } PrimitiveLongPeekingIterator( PrimitiveLongIterator actual ); boolean hasMultipleValues();  }### Answer:
@Test void shouldDetectMultipleValues() { long[] values = new long[]{1, 2, 3}; PrimitiveLongIterator actual = PrimitiveLongCollections.iterator( values ); PrimitiveLongPeekingIterator peekingIterator = new PrimitiveLongPeekingIterator( actual ); assertTrue( peekingIterator.hasMultipleValues() ); for ( long value: values ) { assertEquals( value, peekingIterator.next() ); } assertFalse( peekingIterator.hasNext() ); assertTrue( peekingIterator.hasMultipleValues() ); }
@Test void shouldDetectSingleValue() { long[] values = new long[]{1}; PrimitiveLongIterator actual = PrimitiveLongCollections.iterator( values ); PrimitiveLongPeekingIterator peekingIterator = new PrimitiveLongPeekingIterator( actual ); assertFalse( peekingIterator.hasMultipleValues() ); for ( long value: values ) { assertEquals( value, peekingIterator.next() ); } assertFalse( peekingIterator.hasNext() ); assertFalse( peekingIterator.hasMultipleValues() ); }