Factorial { public int getIterative(int n) { validateInput(n); int result = 1; for (int i = n; i >= 2; i--) { result *= i; } return result; }  int getIterative(int n); int getRecursive(int n); int getTailRecursive(int n);  }
@Test(expected = IllegalArgumentException.class) public void shouldNotCalculateFactorialOfNegativeIntegersIterative() { factorial.getIterative(-1); }
@Test public void factorialOfZeroEqualsToOneIterative() { int result = factorial.getIterative(0); assertEquals(1, result); }
@Test public void factorialOfFiveEqualsTo120Iterative() { int result = factorial.getIterative(5); assertEquals(120, result); }
@Test public void factorialOfSevenEqualsTo5040Iterative() { int result = factorial.getIterative(7); assertEquals(5040, result); }