class CarFactory extends AbstractFactory{
    @Override
    Vehicle createVehicle(String type) {
        return switch (type) {
            case "wolne" -> new SlowCar();
            case "szybkie" -> new FastCar();
            default -> throw new IllegalArgumentException("nie zaimplementowano");
        };
    }   
}
