Sandpile Java Code