class CachingMain {
    public static void main(String[] args) {
        System.out.println("Wzorzec Buforowanie, zainicjowany system pojazdu");
        var vehicle = new Vehicle();
        vehicle.init();
        var suspension = new SuspensionSystem("zawieszenie");
        vehicle.addSystem(suspension);
        System.out.printf("Typy systemów:'%s%n", vehicle.systemTypes());

        var suspensionCache = vehicle.getSystemByType("zawieszenie");
        System.out.printf("Czy zawieszenie takie samo? '%s:%s'%n", suspension.equals(suspensionCache), suspensionCache);
        vehicle.addSystem(new EngineSystem("silnik2"));
    }
}
