### Question:
VehicleTypeJdbcGateway implements VehicleTypeGateway { @Override public VehicleType save(final VehicleType vehicleType) { jdbcTemplate .update("INSERT INTO RENT_A_CAR.VEHICLE_TYPE (TYPE) VALUES (?)", vehicleType.getType()); return vehicleType; } VehicleTypeJdbcGateway(final JdbcTemplate jdbcTemplate); @Override VehicleType save(final VehicleType vehicleType); @Override Optional<VehicleType> findByType(final String type);  }### Answer:
@Test void test_save_duplicateType_doesNotSave() { final VehicleType vehicleType = new VehicleType(); vehicleType.setType("Type"); vehicleTypeGateway.save(vehicleType); Assertions .assertThrows(DuplicateKeyException.class, () -> vehicleTypeGateway.save(vehicleType)); }