code: public static MimeType mimeType(String type) {
          try {
              return new MimeType(type);
          } catch (MimeTypeParseException ex) {
              throw new RuntimeException(ex);
          }
      }
docs: Creates a new {@link javax.activation.MimeType} from a string, but issues a
  {@link RuntimeException} instead of a checked {@link MimeTypeParseException}
  in case the string cannot be parsed. Useful when creating constants for which
  we are certain that no exception should ensue. E.g.:
  <code>
  public class MyClass {
  public final MimeType MY_MIME = mimeType("application/my-mime");
  
  ...
  }
  </code>
  
  @param type a MIME type as a {@link String} (e.g. "text/html").
  
  @return the corresponding {@link MimeType}.
  
  @throws java.lang.RuntimeException if the {@link MimeType} constructor
  throws {@link MimeTypeParseException}.