To prepare the stuffing, peel the eggplants. For eliminating the bitter flavor from eggplants, sprinkle with salt and let them sit for 20 minutes. Then rinse well to remove the salt and pat dry. Then cut them lengthwise, into 3/4-inch thick slices.
Heat oil in a non-stick skillet over medium-low heat. Fry the eggplants until golden brown (don't use too much oil; whatever you use, eggplant will absorb). Place them on a paper towel to absorb the extra oil.
Using a potato masher, mash the eggplants until slightly smooth. Add garlic, walnuts, and basil. Season with salt. Mix well and set aside.
To prepare the tomato cups, carefully cut tops off of each tomato and scoop out seeds and pulp with a melon baller or spoon. Reserve the tops.
Preheat oven to 350 degrees F.
Spray a baking dish lightly with oil spray. Stuff the tomatoes with the eggplant mixture and place them in the baking dish.
Bake them until they start to soften and skins begin to wrinkle (but still hold their shape), about 20-22 minutes.
Remove the baking dish from the oven and top each evenly with mozzarella cheese. Place the reserved tomato tops to the baking dish (not on top of the tomatoes). Broil tomatoes until the cheese is melted and lightly golden.
Put the tomato tops on them. Serve hot as main dish or appetizer.