WhenTest.java - ported when unit tests
When.java - ported reduce() functionality