candy in Java