@Test
public void parameterizedTypeWithRequiredOwnerMissing() throws Exception {

    try {
        Types.newParameterizedType(A.class, B.class);
        fail();
    } catch (IllegalArgumentException expected) {
        String message = "unexpected owner type for " + A.class + ": null";
        assertThat(expected.getMessage(), is(equalTo(message)));
    }
}