Minor example code improvement - isEmpty

Due to educational valores of books, it would be nice to take advantage of awesome new features introduces in java 6 (book quotes even jls of java 7 and example code forces it) and exchange string.length() == 0 with string.isEmpty(). ;)