

public class NumbersImpl implements Numbers {
	
	// Returns true if the integer passed in is a prime number.
	public Boolean isPrime(Integer n){
	    //check if n is a multiple of 2
	    if (n%2==0) return false;
	    //if not, then just check the odds
	    for(int i=3;i*i<=n;i+=2) {
	        if(n%i==0)
	            return false;
	    }
	    return true;
	}
	
	// Returns the factorial value of the number passed in. 
	// For example, 5! = 1 x 2 x 3 x 4 x 5 = 120.
	public Integer factorial(Integer n) throws IllegalArgumentException{
		if ( n < 0 ) { 
			throw new IllegalArgumentException( "Negative numbers are not valid as argument."); 
		}
		return null;
	}
	
	// This method would return an integer, 
	// but actually it performs an infinite loop due to an internal bug.
	public Integer doForever(){
		return null;
	}
	
}
