@Test
public void valueOfShouldThrowExceptionIfTypeIsEmpty() {

    Throwable thrown = catchThrowable(() -> {
        MediaType.valueOf("; charset=utf-8");
    });
    assertThat(thrown).isInstanceOf(IllegalArgumentException.class);
}