OsgiClassPrefixer { public boolean hasPrefix(String type) { return type != null && type.contains(":"); } OsgiClassPrefixer(); @VisibleForTesting protected  OsgiClassPrefixer(@Nullable Function<Class<?>, Optional<Bundle>> bundleRetriever); Optional<String> getPrefix(Class<?> type); Optional<String> stripMatchingPrefix(Bundle bundle, String type); boolean hasPrefix(String type); static final String DELIMITER; }
@Test public void testHasPrefix() throws Exception { OsgiClassPrefixer prefixer = new OsgiClassPrefixer(); assertFalse(prefixer.hasPrefix("MyClassInDefaultPackage")); assertFalse(prefixer.hasPrefix("my.package.MyClass")); assertTrue(prefixer.hasPrefix("my.symbolic.name:my.package.MyClass")); assertTrue(prefixer.hasPrefix("my.symbolic.name:1.2.3:my.package.MyClass")); }