@Test
public void toElementShouldThrowExceptionWhenTypeIsNotDeclared() throws Exception {

    // setup
    final Element element = elements.getPackageElement("java.util");
    final TypeMirror mirror = element.asType();
    // verify
    assertThatThrownBy(() -> {
        // exercise
        TypeElements.toElement(mirror);
    }).isInstanceOf(IllegalArgumentException.class);
}