O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 (see the demo1_class_level_integration() method in the Chapter15Testing 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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required