If you are looking to invest in the stock market, then one of the most effective ways to generate returns is to buy and hold great companies for a long time. When I say long, I don't mean a year or two. I'm talking about decades. The challenge with having such a long time horizon, however, is that it's incredibly hard to determine what the world will look like that far into the future. If you need a reminder as to how fast the world can move, consider this:

So when looking for an investment, you have to make sure it has the ability to stand the test of time. Three companies that appear to have the traits you'd want in a stock for the next decade are 8point3 Energy Partners (NASDAQ:CAFD), Core Laboratories (NYSE:CLB), and General Electric (NYSE:GE). Here's what makes these companies worthy of being included in an portfolio with a decadelong time horizon.   

Image source: Getty Images.

Revenue is locked in for more than a decade

Investing in the solar industry as a whole sounds like a great idea. The industry has been growing at incredible rates and, despite a hiccup here in the U.S. for 2016 and 2017, there is little reason to think it is going to slow down, if you look out on the scale of a decade or longer.

That said, finding a single solar company in which to invest can be a little tougher. The rapid pace of technological innovation means that companies are constantly investing loads of money in research and development, and the desire to compete with fossil fuels over the years has consistently put pressure to lower costs. This has led to a cutthroat environment with thin margins as equipment quickly becomes commoditized. 

Image source: 8Point3 Energy Partners corporate website.

This pretty much applies to any company that tries to sell solar panels or the related equipment. For a company that buys solar panels, it's a very different story, which means this kind of company would be a much more stable investment over the next decade. One business in particular that looks attractive in this vein is 8Point3 Energy Partners. It buys solar projects from its parent organizations, which already have clients lined up to buy the power from those same projects. Today, the average remaining tenor on its power purchasing contracts is 21 years. For an investment with a decadelong time horizon, that is a lot of revenue visibility.

8Point3 Energy Partners has a lot of room for growth, and is currently seeing improving rates of return. If the company can avoid the pitfall of taking on too much debt while rates of return are attractive today, then it would make a great investment for the next decade.

Improving every aspect of the oil production process

There are a lot of talking heads and pundits out there making very bold claims about the rapid demise of the oil and gas industry. Increasing use of electric and hybrid vehicles, coupled with growing demand for wind and solar energy, is expected to take a dent in the fossil fuel business, and some see the tipping point coming relatively soon. While it is entirely possible we could see a rapid adoption of these technologies in developed markets like the U.S. and Europe, the claims don't really take into account the emerging markets where fossil fuels are likely to play a key role in economic development. This means oil and gas can remain an attractive investment for at least a decade.

Image source: Core Laboratories corporate website.

That said, companies can't just grow production willy-nilly. The emergence of shale drilling, the rapid cost reduction with this production source in recent years, and the short amount of time it takes to get a shale well producing mean that exploration and production companies will have to be much more scrutinous about well economics to generate decent returns. That is where Core Laboratories comes in. The company specializes in optimizing well economics by determining the best places to drill a reservoir, the best method to get strong production rates, and ways to improve the recovery rates on mature fields.

This expertise gives it something that few oil services companies have: pricing power. While Core's business will wax and wane with the overall activity of the industry, it is much less at risk of its services becoming commoditized. It also helps that this kind of service isn't a capital-intensive business, which means the company generates the best returns on capital employed among its peers by a wide margin.

CLB Return on Capital Employed (TTM) Chart

CLB Return on Capital Employed (TTM) data by YCharts.

Toss in the company's minuscule debt load and management's propensity to use free cash flow to buy back shares and pay a decent dividend, and you have a stock that looks extremely well positioned to profit over the next decade.  

An old industrial stalwart with a new trick up its sleeve

When it comes to manufacturing and heavy industry, few companies have the brand recognition of General Electric. During its history of more than 100 years, the company has consistently evolved to meet various needs in the energy, transportation, water, and healthcare industries. Its foray into media and finance wasn't as well received, but GE has sold off much of that portfolio to focus on the things it does best. 

Image source: General Electric corporate website.

Today, the name of the game for industrial manufacturers is the Industrial Internet of Things, or IIoT. Capabilities for remote sensing and peer-to-peer communications on every piece of industrial equipment are about to open a whole new world in operational efficiency and cost reduction. Not only is General Electric looking to produce equipment for the IIoT age, but it's also developing the software programs that will potentially be the backbone of this movement: the company's Predix software platform for industrial applications that will make the Internet of Things tick.

Right now, the competition in this industry is fierce as companies try to build the operating system that will form the backbone of the Industrial Internet of Things, and it looks like General Electric is in the lead. According to the company's third-quarter earnings report, revenue from Predix is expected to close the year at $6 billion, and CEO Jeff Immelt sees the platform becoming a business with $15 billion in annual revenue as soon as 2020. Profit margins on software are typically higher than on manufactured products, and the added benefit to Predix is that it is a much more "sticky" revenue source. Because customers pay annual subscription fees, once a company has adopted a platform, it's much harder for it to switch. 

With this new part of the business growing quickly on its own, and the ability to layer IIoT with offerings across the rest of its industrial offerings, General Electric looks to have a growth engine that could fuel it for the next decade and beyond.