If two unrelated classes have the same behavior, you'll be probably better extracting this behavior on some external, isolated class.
In the times of old, this was done quite often in Utilities classes. Almost every project out there had a "Utils" or "Tools" class that had some of miscellaneous stuff for string operations, some number stuff and who knows what else. This wasn't exactly the best way to do this, but it worked fine.
Nowadays is common to segregate non-trivial logic and behaviors on different classes, and them composing them together to achieve the desired effect. This can be done in several different forms of different complexities, with different flavors that will suit different needs. Each one of them has some pros and cons, and a few of them aren't that good if you are thinking in changing stuff in the near future, but you could:
- Use a static class to provide the needed behavior as a static method; (Fast and simple to do, but unless your "Calculate" method is a pure function, avoid this one.)
- Create a external class with the needed behavior and make the classes that need it instantiate it on their own; (good, but easy to break if changes are needed in the future)
- Inject the needed behavior on the constructor of the classes that need it (manually or using some dependency injection framework, if you are already using those). (I recommend this one, personally. I don't like DI frameworks that much but even hand-made DI can make a huge difference).
and so on.
There isn't a single correct way of doing this in a macro level. That said, most of the solutions will require that you isolate this needed behavior somewhere else, out of those classes, so you have there a start!
Just don't copy-paste code around!