Prime method implemented using TDD. Full code coverage.