code review

mainly string.getBytes("UTF-8") replaced by string.getBytes(StandardCharsets.UTF_8)
why it can happen?

.getBytes(UTF_8) do not throw UnsupportedEncodingException