### Question:
Packages { public static boolean shouldBeExported(String packageName) { boolean service = packageName.endsWith(".service"); service = service || packageName.contains(".service.") || packageName.endsWith(".services") || packageName.contains(".services."); boolean api = packageName.endsWith(".api"); api = api || packageName.contains(".api.") || packageName.endsWith(".apis") || packageName.contains(".apis."); boolean model = packageName.endsWith(".model"); model = model || packageName.contains(".model.") || packageName.endsWith(".models") || packageName.contains(".models."); boolean entity = packageName.endsWith(".entity"); entity = entity || packageName.contains(".entity.") || packageName.endsWith(".entities") || packageName.contains(".entities."); return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity); } private  Packages(); static String toClause(List<String> packages); static String getPackageName(String filePath); static boolean shouldBeExported(String packageName);  }### Answer:
@Test public void testExportPackageHeuristicsForServiceAndAPI() { assertThat(Packages.shouldBeExported("")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.service")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.service.data")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.services")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.services.misc.exception")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.api")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.api.svc")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.apis")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.apis.svc")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.apiculteur.svc")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.service4.svc")).isFalse(); }
@Test public void testExportPackageHeuristicsForModelAndEntity() { assertThat(Packages.shouldBeExported("")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.model")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.model.data")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.models")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.models.misc.exception")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.entity")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.entity.svc")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.entities")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.entities.svc")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.modelization.svc")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.entitification.svc")).isFalse(); }