public class Factorial {
  public static long iterative ( final long n ) {
    if ( n < 0 ) { throw new RuntimeException ( "Parameter must be a non-negative integer." ) ; }
    long total = 1 ;
    for ( long i = 2 ; i <= n ; ++i ) { total *= i ; }
    return total ;
  }
  public static long recursive ( final long n ) {
    if ( n < 0 ) { throw new RuntimeException ( "Parameter must be a non-negative integer." ) ; }
    return n < 2 ? 1 : n * recursive ( n - 1 ) ;
  }
}
