Almost all other cases are random Exceptions which we can use standard Java ones or create our own.
The few other one off cases we should replace with our own versions or simple standard Java code. My preference is to use standard java code and core libraries where ever possible. Other places we add our own util classes.
Problem
We should not be importing all of Apache Commons just for a few classes we are using.
Solution
Mostly we seem to use Pair and Triple classes, I have filed a platform issue to add them to platform https://github.com/hashgraph/hedera-services/issues/6648
Almost all other cases are random Exceptions which we can use standard Java ones or create our own.
The few other one off cases we should replace with our own versions or simple standard Java code. My preference is to use standard java code and core libraries where ever possible. Other places we add our own util classes.