You do not need to check `encoding` against `null` when using `equalsIgnoreCase` in this way.