Soak the beans overnight and simmer the next day in salted water for about 1 1/2 hours.
Mix the olive oil, vinegar, pepper and the grated garlic cloves to a sauce and pour over the warm beans. Mix well and cover and let stand in a cool place for a few hours.
Wash and cut the tomatoes into eighths. Halve the olives. Peel the onions and cut into thin rings. Add everything to the beans, mix well and serve.