Source extends SourceConfiguration implements Comparable<Source> { public int concurrentDownload() { return calculatorMap.size(); } Source();   Source(SourceConfiguration config); long getBandwidth(); int concurrentDownload(); synchronized boolean generateBandwidthCalculator(String identifier); void populateBandwidthCalculator(String id, long transferredBytes); long getCalculatedBandwidth(String id); void removeBandwidthCalculator(String id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Source o); void close();  }
@Test public void concurrentDownload() { Source source = new Source(); Assert.assertEquals(source.concurrentDownload(), 0); String calculatorId = UUID.randomUUID().toString(); Assert.assertTrue(source.generateBandwidthCalculator(calculatorId)); Assert.assertEquals(source.concurrentDownload(), 1); source.removeBandwidthCalculator(calculatorId); Assert.assertEquals(source.concurrentDownload(), 0); }