How to do it...

There are several levels of integration. We need to integrate the classes and subsystems of the application and also integrate our application with the external system (the source of the traffic data developed and maintained by a third party).

Here is an example of class-level integration using the demo1_class_level_integration() method in the Chapter14Testing class:

String result = IntStream.rangeClosed(1,   speedLimitByLane.length).mapToDouble(i -> {    AverageSpeed averageSpeed =       new AverageSpeed(trafficUnitsNumber, timeSec,                        dateLocation, speedLimitByLane, i,100);    ForkJoinPool commonPool = ForkJoinPool.commonPool();    return commonPool.invoke(averageSpeed);}).mapToObj(Double::toString).collect(Collectors.joining(", "));System. ...

Get Java 11 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.