public void registerStrategy(BatchingStrategy<?, ?, ?> strategy) {
    _strategies.add(strategy);
  }
@Test
  public void testBatchWithTimeoutAndSingleton() {

    RecordingStrategy<Integer, Integer, String> strategy =
        new RecordingStrategy<Integer, Integer, String>((key, promise) -> promise.done(String.valueOf(key)), key -> key % 2) {
      @Override
      public void executeBatch(final Integer group, final Batch<Integer, String> batch) {
        getScheduler().schedule(() -> {
          super.executeBatch(group, batch);
        }, 250, TimeUnit.MILLISECONDS);
      }
    };

    _batchingSupport.registerStrategy(strategy);

    Task<String> task = Task.par(strategy.batchable(0).withTimeout(10, TimeUnit.MILLISECONDS).recover("toExceptionName", e -> e.getClass().getName()),
        strategy.batchable(1), strategy.batchable(2))
        .map("concat", (s0, s1, s2) -> s0 + s1 + s2);

    String result = runAndWait("TestBatchingSupport.testBatchWithTimeoutAndSingleton", task);

    assertEquals(result, "java.util.concurrent.TimeoutException12");
    assertTrue(strategy.getClassifiedKeys().contains(0));
    assertTrue(strategy.getClassifiedKeys().contains(1));
    assertTrue(strategy.getClassifiedKeys().contains(2));
    assertEquals(strategy.getExecutedBatches().size(), 1);
    assertEquals(strategy.getExecutedSingletons().size(), 1);
  }