ThrowingIntPredicate tests; plus some code refactoring