Java program testing