public static long factorial(final int n) {
        if (n > 20 || n < 0) {
            throw new IllegalArgumentException(n + " is out of range");
        }
        return LongStream.rangeClosed(2, n).reduce(1, (a, b) -> a * b);
    }
General Permutation support from
http://minborgsjavapot.blogspot.com/2015/07/java-8-master-permutations.html

@author Per Minborg
common-parent/combinatorics/src/main/java/com/speedment/common/combinatorics/internal/PermutationUtil.java