Java9StreamUtil { @SuppressWarnings("unchecked") public static DoubleStream dropWhile(DoubleStream stream, DoublePredicate predicate) { requireNonNull(stream); requireNonNull(predicate); if (DOUBLE_DROP_WHILE_METHOD_HANDLE == null) { throw newUnsupportedOperationException(DROP_WHILE); } try { final Object obj = DOUBLE_DROP_WHILE_METHOD_HANDLE.invoke(stream, predicate); return (DoubleStream) obj; } catch (Throwable t) { throw new SpeedmentException(t); } } private  Java9StreamUtil(); @SuppressWarnings("unchecked") static DoubleStream takeWhile(DoubleStream stream, DoublePredicate predicate); @SuppressWarnings("unchecked") static DoubleStream dropWhile(DoubleStream stream, DoublePredicate predicate); @SuppressWarnings("unchecked") static IntStream takeWhile(IntStream stream, IntPredicate predicate); @SuppressWarnings("unchecked") static IntStream dropWhile(IntStream stream, IntPredicate predicate); @SuppressWarnings("unchecked") static LongStream takeWhile(LongStream stream, LongPredicate predicate); @SuppressWarnings("unchecked") static LongStream dropWhile(LongStream stream, LongPredicate predicate); @SuppressWarnings("unchecked") static Stream<T> takeWhile(Stream<T> stream, Predicate<? super T> predicate); @SuppressWarnings("unchecked") static Stream<T> dropWhile(Stream<T> stream, Predicate<? super T> predicate);  }
@Test void testDropWhile() { if (JavaVersionUtil.is8()) { try { Java9StreamUtil.dropWhile(STREAM_SUPPLIER.get(), LESS_THAN_C); fail("dropWhile should not be supported by this Java version"); } catch (UnsupportedOperationException e) { } } else { final List<String> expected = Arrays.asList("c", "d", "e", "a"); final List<String> actual = Java9StreamUtil.dropWhile(STREAM_SUPPLIER.get(), LESS_THAN_C).collect(toList()); assertEquals(expected, actual); } }