1. Cook the corn and the beans. Drain them and measure 4 cups of black beans after cooking; measure the corn before cooking.
2. Chop the onion finely.
3. Toss together all ingredients, ideally while the beans and corn are still warm from cooking.
4. Allow to cool, tossing occasionally. Refrigerate.