### Question:
ReactorDemo implements ReactiveStreamsDemo { public static Flux<Long> exampleSquaresUsingGenerate() { Flux<Long> squares = Flux.generate( AtomicLong::new, (state, sink) -> { long i = state.getAndIncrement(); sink.next(i * i); if (i == 10) sink.complete(); return state; }); return squares; }  static Flux<Long> exampleSquaresUsingGenerate(); static List<Integer> doSquares(); static List<Integer> doParallelSquares(); @Override Future<List<Integer>> doSquaresAsync(int count); @Override Future<String> doStringConcatAsync(int count); @Override Future<List<Integer>> doParallelSquaresAsync(int count); @Override Future<String> doParallelStringConcatAsync(int count); static void runComputation(); static void writeFile(File file); static void readFile(File file); static void useProcessor();  }### Answer:
@Test(timeout = 1000) public void testGenerate() { Flux<Long> flux = ReactorDemo.exampleSquaresUsingGenerate(); List<Long> list = flux.collectList().block(); assertEquals(11, list.size()); }