### Question:
FightCalculator { public Fight attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round) { LOGGER.debug("Fight between {} and {}", attackingShips, defendingShips); Ships remainingDefendingShips = fight(attackingShips, defendingShips); Ships remainingAttackingShips = fight(defendingShips, attackingShips); LOGGER.debug("Remaining ships from attacker: {}", remainingAttackingShips); LOGGER.debug("Remaining ships from defender: {}", remainingDefendingShips); return new Fight(uuidFactory.create(), attackerId, defenderId, planetId, attackingShips, defendingShips, remainingAttackingShips, remainingDefendingShips, round, Resources.NONE); } FightCalculator(UUIDFactory uuidFactory, RandomNumberGenerator randomNumberGenerator, ShipMechanics shipMechanics); Fight attack(UUID attackerId, UUID defenderId, UUID planetId, Ships attackingShips, Ships defendingShips, long round);  }### Answer:
@Test public void testAttack() throws Exception { Fight fight = sut.attack(ATTACKER_ID, DEFENDER_ID, PLANET_ID, new Ships(new Ship(ShipType.MOSQUITO, 5)), new Ships(new Ship(ShipType.MOSQUITO, 3)), ROUND); assertThat(fight.getRemainingAttackerShips().countByType(ShipType.MOSQUITO), is(2L)); assertThat(fight.getRemainingDefenderShips().countByType(ShipType.MOSQUITO), is(0L)); }
@Test public void testAttack2() throws Exception { Fight fight = sut.attack(ATTACKER_ID, DEFENDER_ID, PLANET_ID, new Ships(new Ship(ShipType.MOSQUITO, 5)), new Ships(new Ship(ShipType.MOSQUITO, 5)), ROUND); assertThat(fight.getRemainingAttackerShips().countByType(ShipType.MOSQUITO), is(0L)); assertThat(fight.getRemainingDefenderShips().countByType(ShipType.MOSQUITO), is(0L)); }
@Test public void testAttack3() throws Exception { Fight fight = sut.attack(ATTACKER_ID, DEFENDER_ID, PLANET_ID, new Ships(new Ship(ShipType.MOSQUITO, 3)), new Ships(new Ship(ShipType.MOSQUITO, 5)), ROUND); assertThat(fight.getRemainingAttackerShips().countByType(ShipType.MOSQUITO), is(0L)); assertThat(fight.getRemainingDefenderShips().countByType(ShipType.MOSQUITO), is(2L)); }
@Test public void testAttack4() throws Exception { Fight fight = sut.attack(ATTACKER_ID, DEFENDER_ID, PLANET_ID, new Ships(new Ship(ShipType.MOSQUITO, 5)), new Ships(new Ship(ShipType.COLONY, 1)), ROUND); assertThat(fight.getRemainingAttackerShips().countByType(ShipType.MOSQUITO), is(5L)); assertThat(fight.getRemainingDefenderShips().countByType(ShipType.COLONY), is(0L)); }
@Test public void testAttack5() throws Exception { Fight fight = sut.attack(ATTACKER_ID, DEFENDER_ID, PLANET_ID, new Ships(new Ship(ShipType.MOSQUITO, 4)), new Ships(new Ship(ShipType.COLONY, 1)), ROUND); assertThat(fight.getRemainingAttackerShips().countByType(ShipType.MOSQUITO), is(4L)); assertThat(fight.getRemainingDefenderShips().countByType(ShipType.COLONY), is(1L)); }