There are several nested methods defined inside findBestSplits. Some of them are complex enough to have unit tests of their own.