You can use
entry.getValue().toString()
or String.valueOf(entry.getValue())
instead of (String) entry.getValue()
.