LiteratePrograms: "Miller-Rabin Primality Test"

Create a java language program that performs Miller-Rabin primality test. One possible solution can be found via the link above. Study the solution code only after you have solved the problem or spent a substantial amount of time working on it.