@Override public Variant expectedVariant() { List<Variant> variants=VariantUtils.defaultVariants(); Variant variant=this.request.selectVariant(variants); if(variant==null) { throw new NotAcceptableException(this); } String acceptableCharset=acceptedCharset(); if(acceptableCharset==null) { throw new NotAcceptableException(this); } return Variant. encodings(variant.getEncoding()). languages(variant.getLanguage()). mediaTypes(variant.getMediaType().withCharset(acceptableCharset)). add(). build(). get(0); }