public static BigInteger factorial(BigInteger n) {
		if (n.equals(BigInteger.ZERO)) {
			return BigInteger.ONE;
		}
		return factorial(n, BigInteger.ZERO);
	}
@Test
	public void factorialTest(){
		long factorial = NumberUtil.factorial(0);
		assertEquals(1, factorial);

		assertEquals(1L, NumberUtil.factorial(1));
		assertEquals(1307674368000L, NumberUtil.factorial(15));
		assertEquals(2432902008176640000L, NumberUtil.factorial(20));

		factorial = NumberUtil.factorial(5, 0);
		assertEquals(120, factorial);
		factorial = NumberUtil.factorial(5, 1);
		assertEquals(120, factorial);

		assertEquals(5, NumberUtil.factorial(5, 4));
		assertEquals(2432902008176640000L, NumberUtil.factorial(20, 0));
	}