### Question:
ShipUtils { public long calculateStorageCapacity(Ships ships, ShipMechanics shipMechanics) { Preconditions.checkNotNull(ships, "ships"); Preconditions.checkNotNull(shipMechanics, "shipMechanics"); return ships.stream().mapToLong(s -> shipMechanics.getCargoSpace(s.getType())*s.getAmount()).sum(); }  long calculateStorageCapacity(Ships ships, ShipMechanics shipMechanics); double findSpeedOfSlowestShip(Ships ships, ShipMechanics shipMechanics); Hangar getOrCreateHangar(HangarDAO hangarDAO, UUIDFactory uuidFactory, UUID planetId, UUID playerId);  }### Answer:
@Test public void testCalculateStorageCapacity() throws Exception { Ship daggers = new Ship(ShipType.DAGGER, 5); Ship mules = new Ship(ShipType.MULE, 2); Ships ships = new Ships(Arrays.asList(daggers, mules)); long actualCapacity = utils.calculateStorageCapacity(ships, shipMechanics); assertEquals(actualCapacity, 5*shipMechanics.getCargoSpace(ShipType.DAGGER) + 2*shipMechanics.getCargoSpace(ShipType.MULE)); }