@Test(expected = IllegalArgumentException.class) public void shouldNotCalculateFactorialOfNegativeIntegersIterative() { factorial.getIterative(-1); }
public int getIterative(int n) { validateInput(n); int result = 1; for (int i = n; i >= 2; i--) { result *= i; } return result; }
Factorial { public int getIterative(int n) { validateInput(n); int result = 1; for (int i = n; i >= 2; i--) { result *= i; } return result; } }
Factorial { public int getIterative(int n) { validateInput(n); int result = 1; for (int i = n; i >= 2; i--) { result *= i; } return result; }  }
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); }
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);  }