@Override
  public Map<String, Long> call() throws Exception {
    Map<String, Long> result = new LinkedHashMap<>();
    for (DownloadableItem item : items) {
      InputStreamWrapper stream = connectionProvider.getInputStreamForItem(jobId, item);
      long size = stream.getBytes();
      if (size <= 0) {
        size = computeSize(stream);
      }

      result.put(item.getIdempotentId(), size);
    }

    return result;
  }
@Test
  public void testExceptionIsThrown() throws Exception {
    when(connectionProvider.getInputStreamForItem(any(), any()))
        .thenThrow(new IOException("oh no!"));
    assertThrows(IOException.class, () -> {
      new CallableSizeCalculator(jobId, connectionProvider,
          Collections.singleton(createItem("1-3242"))).call();
    });
  }