Prior to this commit, a ClassCastException was thrown for an Optional return type for an @HttpExchange method. This is because the check for an Optional return type was based on the type contained in the Optional instead of the Optional itself. Closes gh-28493