Preheat oven to 350°.
In a pot over medium heat, add 2 cups soy milk, mushrooms, garlic, and black pepper. Slowly bring to boil, then reduce heat to simmer.
Dissolve the cornstarch into remaining 1/2 cup of soy milk, add to pot. Stir well for 5 minutes and remove from heat.
Drain beans and pour into a casserole dish.
Add about 1 cup of the onions to the beans, as well as the soy milk mixture, and toss.
Place in oven for 35-45 minutes. Top with rest of onions and cook for a few more minutes, until onions are brown. Let sit for 10-15 minutes before serving.