final class FactoryProvider {
    private FactoryProvider(){}
    static AbstractFactory getFactory(String type){
        return switch (type) {
            case "auto" -> new CarFactory();
            case "ciężarówka" -> new TruckFactory();
            default -> throw new IllegalArgumentException("""
                this is %s""".formatted(type));
        };
    } 
}
