The government's stress test results are now old news; Morgan Stanley (NYSE:MS) and Wells Fargo (NYSE:WFC), for example, have already completed equity offerings to shore up their capital. Morgan Stanley, Goldman Sachs (NYSE:GS), and JPMorgan Chase (NYSE:JPM) have made formal requests to repay $45 billion in TARP funds. Investors seem to be reassured that the 19 "systemically important institutions" are well on their way to getting their house in order. But what about the rest of the banking system -- the remaining third of total bank assets in the U.S.?

Sandler O'Neill, a boutique investment firm focused on the financial services industry, applied the government's stress test methodology to the entire banking industry. They found that 38% of the 200 firms that sit just below the "big 19" are undercapitalized with an aggregate capital shortfall of $16.2 billion. The shortfall for all banks adds up to $24 billion.

Overbanked and undercapitalized
On the bright side, that amount is less than Bank of America (NYSE:BAC) is required to raise by itself. However, these results will undoubtedly put pressure on smaller institutions to raise their capital, and it's far from clear that they will have the same flexibility as the big boys to tap the capital markets. As a result, we can expect a wave of failures and acquisitions among small and mid-tier banks.

That's no bad thing: The U.S. banking system may be too concentrated at the very top, but with around 8,000 banks, it's clearly too fragmented below the "too big to fail" threshold.

Investors: focus on quality
Last September, I wrote: "I think we could see a large wave of bank failures, possibly numbering in the hundreds. Not megabanks like Citigroup (NYSE:C), Bank of America, or JPMorgan Chase, but small/mid-sized banks." With 33 bank failures since the start of the year and 60 since the start of the credit crisis, we're far short of that mark. However, Sandler O'Neill estimates that up to 500 banks could shutter before all is said and done. Bank share investors have been warned: Focus on the highest quality names.

More Foolishness:

Take a hint from Warren Buffett's recent investments in Goldman Sachs preferred shares with fat yields: In this market, dividends -- those that are sustainable -- will be a big component of future shareholder returns. The team at Motley Fool Income Investor can show you how to build -- and manage -- a portfolio of stocks that pay a solid yield. To find out their top five recommendations for new money now, take advantage of a 30-day free trial today.

Alex Dumortier, CFA has a beneficial interest in Wells Fargo, but not in any other of the companies mentioned in this article. Try any of our Foolish newsletters today, free for 30 days. The Motley Fool has a disclosure policy.