@Test
  public void notifiesOnStateChange() {
    Transaction t = new DummyTransaction();
    t.onProgress(() -> progress.add(null));
    t.toState(FAILED);

    assertEquals(1, progress.size());
  }
  @Test
  public void notifiesOnProgress() {
    Transaction t = new DummyTransaction();
    t.onProgress(() -> progress.add(null));
    t.setTransferred(10L);

    assertEquals(1, progress.size());
  }