         if(service != null){             Set<MediaType> mediaTypes = parseMediaTypes(((ModelWriter)service).supportedMediaTypes());             Class<? extends Representation> nativeType = ((ModelWriter)service).getNativeType();             if(!mediaTypes.isEmpty()){                 lock.writeLock().lock();                 try {                     for(MediaType mediaType : mediaTypes){                         