### Question:
CachingSpaceUsageSource implements SpaceUsageSource { @Override public long getUsedSpace() { return cachedValue.get(); } CachingSpaceUsageSource(SpaceUsageCheckParams params); @VisibleForTesting  CachingSpaceUsageSource(SpaceUsageCheckParams params,
      ScheduledExecutorService executor); @Override long getCapacity(); @Override long getAvailable(); @Override long getUsedSpace(); void start(); void shutdown();  }### Answer:
@Test public void providesInitialValueUntilStarted() { final long initialValue = validInitialValue(); SpaceUsageCheckParams params = paramsBuilder(new AtomicLong(initialValue)) .withRefresh(Duration.ZERO) .build(); SpaceUsageSource subject = new CachingSpaceUsageSource(params); assertEquals(initialValue, subject.getUsedSpace()); }
@Test public void ignoresMissingInitialValue() { SpaceUsageCheckParams params = paramsBuilder() .withRefresh(Duration.ZERO) .build(); SpaceUsageSource subject = new CachingSpaceUsageSource(params); assertEquals(0, subject.getUsedSpace()); }