@Override
    @PublicAPI(usage = ACCESS)
    public Set<? extends JavaAnnotation<JavaPackage>> getAnnotations() {
        return packageInfo
                .map(it -> it.getAnnotations().stream().map(withSelfAsOwner).collect(toSet()))
                .orElse(emptySet());
    }
@Test
    public void test_getAnnotations() {
        JavaPackage annotatedPackage = importPackage("packageexamples.annotated");
        JavaPackage nonAnnotatedPackage = importPackage("packageexamples");

        JavaAnnotation<JavaPackage> annotation = getOnlyElement(annotatedPackage.getAnnotations());
        assertThatType(annotation.getRawType()).matches(PackageLevelAnnotation.class);
        assertThat(annotation.getOwner()).isEqualTo(annotatedPackage);

        assertThat(nonAnnotatedPackage.getAnnotations()).isEmpty();
    }