Need proof that buying and holding stocks over the long term is the best way to build wealth in the stock market? Just look at the success of long-term investors such as Warren Buffett, T. Rowe Price, and Peter Lynch. These legendary stock pickers weren't great because they picked a stock and rode it for a week. Many of their best investments were the ones they held on to for years and decades at a time.

The key to this type of investing is finding companies that will stand the test of time. So we asked three of our investing contributors to each highlight a stock they own that they have no intention of selling anytime soon. Here's why they picked A.O. Smith (NYSE:AOS), 8point3 Energy Partners (NASDAQ:CAFD), and Brookfield Asset Management (NYSE:BAM)

Stock index board, $100 bill, and clock all superimposed on top of each other.

Image source: Getty Images

A steaming hot investment in a seemingly ice-cold industry

Tyler Crowe (A.O. Smith): When it comes to buying something with the intention of holding it forever, the companies I gravitate toward are the ones that satisfy a basic need we use on an everyday basis: water, food, sanitation, things like that. No matter how much technology disrupts our daily lives, these are things that will always be an essential part of our lives. That's what provides the foundation for my investment in water heater manufacturer A.O. Smith, but there's much more to it than that.

Hot water is one of those must-haves in any household, and whenever a water heater breaks, it's almost instantly repaired or replaced. A.O. Smith has more than 40% of the U.S. market for residential water heaters and more than 50% for tankless gas heaters. More than 85% of residential water heaters in the U.S. are replacements rather than for new housing starts, so it is an incredibly steady business that generates high margin and excellent rates of return.

The most exciting part of A.O. Smith's business -- if you want to call anything in water heaters exciting -- is the company's growth opportunities in China and India. As more and more people enter the middle class in these markets, they're looking to buy higher-quality, more reliable home products, and A.O. Smith's water heaters fit that description. Since 2002, the company has grown sales in China 22% annually and increased its market share from less than a 5% to more than 25% of the market. The company is also gaining a lot of traction with water and air purification systems in the Chinese market, and management believes there is a similar billion-dollar opportunity in India.

Time changes a lot of things, but meeting our basic human needs is always a surefire bet for a long-term investment. With a dominant market share, a high rate of replacement revenue, and two incredible growth levers in the wings, it will be hard for me to part ways with my shares of A.O. Smith.

A renewable-energy dividend built to last

Travis Hoium (8point3 Energy Partners): It isn't often that you can buy a stock that has virtually guaranteed cash flows and dividends for 20 years, or more. Yieldcos like 8point3 Energy Partners are just that kind of investment, given the contracts they have to sell electricity to utilities. In 8point3 Energy's case, its weighted average power purchase agreement life left on its 946 MW portfolio is 19.4 years. 

That stability in cash flow is what drives the company's dividend and ability to buy more projects. Sometimes projects are purchased with excess cash flow, but usually, they're acquired by selling stock and new debt, which allows the yieldco to grow its dividend long-term. 

8point3 Energy Partners is in a unique position because it has a relatively high dividend yield of 7.2%, which makes it challenging to acquire projects by issuing shares. If nothing changes, investors will just collect the dividend for the next 19.4 years, which isn't all bad, because the way yieldcos are structured the first six or seven years of that dividend will even be tax-free because it's a "return of capital" to shareholders. After initial contracts expire, the company will sign new power purchase agreements or update projects with new equipment. Each project could probably viably produce 30 or 40 years of electricity, giving them decades of life. 

What makes 8point3 Energy Partners attractive today is that its sponsors are trying to sell it. A buyout could lead to a short-term payoff, or it could mean bringing in a new sponsor that would be able to grow the company and its dividend long-term. This is exactly what happened to TerraForm Power when Brookfield Asset Management bought the company, a strategy that could be replicated with 8point3 Energy Partners if the sponsors are replaced

Given the long-term contracted cash flows, high yield, and potential that this becomes a growth dividend again, this is a stock I'm never selling.

AOS Total Return Price Chart

AOS Total Return Price data by YCharts

I win twice holding this stock

Matt DiLallo (Brookfield Asset Management): One of my favorite holdings is Brookfield Asset Management. It's hard not to like a stock that has more than doubled the money I've invested in it over the years.

But the profits alone aren't the only glue that keeps it in my portfolio. Instead, an even more important factor for me is that I learn so much about investing by observing how Brookfield itself invests money. That's not hard to do, because the company goes to great lengths to share its wealth of knowledge with shareholders through quarterly letters, which management fills with investing nuggets. 

For example, in its third-quarter letter, CEO Bruce Flatt pointed out the importance of consistently hitting singles and doubles with its investments. Management does so by looking for value in areas other investors won't touch. That led management to invest in Brazil during its recent political crisis, which enabled the company to score excellent deals on assets that should drive high returns for years. The real-world examples it shares provides me with invaluable information that I can use to make better investment decisions. 

Holding Brookfield is a no-brainer for me, since it should continue enriching my portfolio and investment knowledge for years to come. 

Matthew DiLallo owns shares of Brookfield Asset Management. Travis Hoium owns shares of 8point3 Energy Partners. Tyler Crowe owns shares of 8point3 Energy Partners, A.O. Smith, and Brookfield Asset Management. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.