Changing countObjects return type to Integer.