@Test
    void direct_usage_of_non_publicApi_packages_is_detected() {
        var nonPublicApiAttribute = mainAttributes.getValue("X-JDisc-Non-PublicApi-Import-Package");
        assertNotNull(nonPublicApiAttribute);
        var usedNonPublicApi = Arrays.stream(nonPublicApiAttribute.split(",")).collect(Collectors.toSet());

        // Package 'ai.vespa.internal' is only used indirectly by the compile scoped dependency, and must not be included.
        assertFalse(usedNonPublicApi.contains("ai.vespa.internal"));

        assertEquals(2, usedNonPublicApi.size());
        assertTrue(usedNonPublicApi.contains("ai.vespa.lib.non_public"));
        assertTrue(usedNonPublicApi.contains("com.yahoo.lib.non_public"));
    }
Tests for a USER bundle that imports non-PublicApi packages.

@author gjoranv
bundle-plugin-test/integration-test/src/test/java/com/yahoo/container/plugin/NonPublicApiDetectionTest.java