Not Germany, but Dale Vince of Ecotricity made an interesting point about Russian gas in the context of sanctions/calls for boycotts. iirc, I think he said about five per cent of his company's gas supplies were from Russia and he'd looked into breaking the contract but in the end decided not to.
This was because cancelling the contract early would trigger penalty clauses and they'd have to pay the Russian gas company * more * money, not less, so as a means of punishing Russia/Russian companies, it would backfire, because punishing them by cancelling the gas contract would actually result in them being better off financially, not worse off.
Although he said when the contract ended they wouldn't renew/sign up for a new one with Russian suppliers.
So it's not always as simple and effective as you might think, to say boycott/cancel contracts.