Fixed error by importing class Character instead of using java-provided Character.