percolation in Java