@Override
  public void commitOffset(Offset offset) {
    if (!committer.isRunning()) {
      throw new IllegalStateException(
          "Committer not running when commitOffset called.", committer.failureCause());
    }
    try {
      committer.commitOffset(offset).get(1, TimeUnit.MINUTES);
    } catch (Exception e) {
      throw toCanonical(e).underlying;
    }
  }
@Test
  public void commit() {
    doReturn(ApiFutures.immediateFuture(null)).when(fakeCommitter).commitOffset(Offset.of(42));
    committer.commitOffset(Offset.of(42));
  }