polya java