The Exchanger class has another version of the exchange method: exchange(V data, long time, TimeUnit unit). where, V is the type used as a parameter in the declaration of Phaser (List<String> in our case). The thread will sleep until it's interrupted, another thread arrives, or the specified time passes. In this case, a TimeoutException is thrown. The TimeUnit class is an enumeration with the following constants: DAYS, HOURS, MICROSECONDS, MILLISECONDS, MINUTES, NANOSECONDS, and SECONDS.