Heat the olive oil. Add the smashed garlic and rosemary. Cook for a few minutes to release flavors. Don't let the garlic burn. Remove garlic and rosemary and cool oil.
Mix oil, anchovies,and parmesan by blending or whisking rapidly.
Mix the beans,tomatoes, and onions.
Pour dressing overbthe bean mixture.
Squeeze in the juiceof 1/2 a lemon. Salt and pepper to taste.
Garnish with choppedparsley.
Let sit for at least 15 minutes for beans to absorb the dressing.