TDD practice, modeling a math problem in Java and removing conditionals in favor of polymorphism