Java SE 8以降の開発ではfor文の利用頻度が減る。ラムダ式とStream APIが中心に Java EE 7から、サーバ・サイドにおいてもスレッド(並列処理)の実装が可能になりました。具体的には、「Concurrency Utilities for EE 7」により、スレッドをアプリケーション・サーバの管理下で動かせるようになっています。また、Java SE 8では、並列処理の実装を支援するクラスとしてCompletableFutureが追加されました。これらのAPIを組み合わせることにより並列処理の実装がどう楽になるのかを、次の例題で考えてみます。 この処理をJava SE環境で実装するとしたら、一般的には次のようになるでしょう。 手順(1):固定長のスレッド・プールを持つExecutorServiceオブジェクトを生成する 手順(2):ExecutorCompletionSer