Soak 500g of dried medium white beans for 8-12 hours in water with 1 teaspoon of salt. Drain and rinse well.
Heat 3 tablespoons of olive oil in a large pot. Add 2 diced celery stalks, 3 diced carrots, 1 chopped onion, and 5 chopped garlic cloves and cook gently for 15-20 minutes.
Stir in 1 tablespoon of tomato paste for 1 minute. Add the beans, 3 bay leaves, 2 rosemary sprigs, 1 vegetable bouillon cube, 1 whole red apple, and 2 liters of water.
Simmer for 1-1½ hours, until the beans are tender, seasoning with salt and pepper 10 minutes before the end. Discard the apple.