/** * This template method starts the Java 8 stream processing to * search the list of input strings for the given phrases to find. */ @Override protected void initiateStream() { // Create a new barrier for this iteration cycle. mExitBarrier = new CountDownLatch(1); // Execute the test and time how long it runs. List<List<SearchResults>> results = RunTimer.timeRun(() -> processStream(), TAG); // Print the results. printResults(TAG, results); // Indicate all computations in this iteration are done. try { mExitBarrier.countDown(); } catch (Exception ex) { throw new RuntimeException(ex); } }