SanStorage extends HarddriveStorage { @Override public double addFile(final File file) { final double time = super.addFile(file); if(time > 0) return time + getTransferTime(file); return time; } SanStorage(final long capacity, final double bandwidth, final double networkLatency);  SanStorage(final String name, final long capacity, final double bandwidth, final double networkLatency); @Override double addReservedFile(final File file); @Override double addFile(final File file); @Override double getTransferTime(final int fileSize); @Override double deleteFile(final File file); double getBandwidth(); final void setBandwidth(final double bandwidth); double getNetworkLatency(); final void setNetworkLatency(final double networkLatency); @Override String toString();  }
@Test public void testAddFileWhenParamIsFile() { final SanStorage instance = createSanStorage(BANDWIDTH); File file = null; assertEquals(0, instance.addFile(file)); file = new File(FILE1, FILE_SIZE); assertTrue(instance.addFile(file) > FILE_TRANSFER_TIME); }
@Test public void testAddFileWhenParamIsList() { final SanStorage instance = createSanStorage(BANDWIDTH); final List<File> list = HarddriveStorageTest.createFileList(TOTAL_FILES, FILE_SIZE); final double transferTimeOfAllFiles = FILE_TRANSFER_TIME * TOTAL_FILES; assertTrue(instance.addFile(list) > transferTimeOfAllFiles); }