@Test
void testTakeWhile() {

    if (JavaVersionUtil.is8()) {
        try {
            Java9StreamUtil.takeWhile(STREAM_SUPPLIER.get(), LESS_THAN_C);
            fail("takeWhile should not be supported by this Java version");
        } catch (UnsupportedOperationException e) {
            // Expected for Java 8
        }
    } else {
        final List<String> expected = Arrays.asList("a", "b");
        final List<String> actual
            = Java9StreamUtil.takeWhile(STREAM_SUPPLIER.get(), LESS_THAN_C).collect(toList());
        assertEquals(expected, actual);
    }
}