@Override
    @PublicAPI(usage = ACCESS)
    public <A extends Annotation> Optional<A> tryGetAnnotationOfType(Class<A> type) {
        if (packageInfo.isPresent()) {
            return packageInfo.get().tryGetAnnotationOfType(type);
        }
        return Optional.empty();
    }
@Test
    public void test_tryGetAnnotationOfType_type() {
        JavaPackage annotatedPackage = importPackage("packageexamples.annotated");
        JavaPackage nonAnnotatedPackage = importPackage("packageexamples");

        assertThat(annotatedPackage.tryGetAnnotationOfType(PackageLevelAnnotation.class)).isPresent();
        assertThat(annotatedPackage.tryGetAnnotationOfType(Deprecated.class)).isEmpty();

        assertThat(nonAnnotatedPackage.tryGetAnnotationOfType(Deprecated.class)).isEmpty();
    }