Small Java program for prime numbers calculation