Given: and the code fragment: ForkJoinPool fjPool = new ForkJoinPool ( ); int data [ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} fjPool.invoke (new Sum (data, 0, data.length)); and given that the sum of all…

Given: public class Foo<K, V> { private K key; private V value; public Foo (K key, V value) (this.key = key; this value = value;) public static <T> Foo<T, T> twice (T value) (return new Foo<T, T> (value, value); )…

Given the code fragment: Stream<List<String>> iStr= Stream.of ( Arrays.asList (“1”, “John”), Arrays.asList (“2”, null)0; Stream<<String> nInSt = iStr.flatMapToInt ((x) -> x.stream ()); nInSt.forEach (System.out :: print); What is the result? A. 1John2null B. 12 C. A NullPointerException is thrown at…

Given the definition of the Vehicle class: and this code fragment: Vehicle v = new Vehicle (100); v.increSpeed(60); What is the result? A. Velocity with new speed B. A compilation error occurs at line n1. C. A compilation error occurs…

Given: IntStream stream = IntStream.of (1,2,3); IntFunction<Integer> inFu= x -> y -> x*y; //line n1 IntStream newStream = stream.map(inFu.apply(10)); //line n2 newStream.forEach(System.output::print); Which modification enables the code fragment to compile? A. Replace line n1 with: IntFunction<UnaryOperator> inFu = x ->…

Given the code fragment: What is the result? A. 246 B. The code produces no output. C. A compilation error occurs at line n1. D. A compilation error occurs at line n2.