Java implementation of Stupid