Elementary cellular automaton implementation in Java