### Question:
ExportsBuilder { @SuppressWarnings({"UnusedDeclaration"}) public String determineExports(List<HostComponentRegistration> regs, PackageScannerConfiguration packageScannerConfig, File cacheDir) { return determineExports(regs, packageScannerConfig); }  String getExports(List<HostComponentRegistration> regs, PackageScannerConfiguration packageScannerConfig); @SuppressWarnings({"UnusedDeclaration"}) String determineExports(List<HostComponentRegistration> regs, PackageScannerConfiguration packageScannerConfig, File cacheDir);  }### Answer:
@Test public void testConstructJdkExportsWithJdk5And6() { String jdkVersion = System.getProperty("java.specification.version"); try { System.setProperty("java.specification.version", "1.5"); String exports = builder.determineExports(new ArrayList<HostComponentRegistration>(), new DefaultPackageScannerConfiguration()); assertFalse(exports.contains("javax.script")); System.setProperty("java.specification.version", "1.6"); exports = builder.determineExports(new ArrayList<HostComponentRegistration>(), new DefaultPackageScannerConfiguration()); assertTrue(exports.contains("javax.script")); } finally { System.setProperty("java.specification.version", jdkVersion); } }
@Test public void testDetermineExports() { DefaultPackageScannerConfiguration config = new DefaultPackageScannerConfiguration("0.0"); String exports = builder.determineExports(new ArrayList<HostComponentRegistration>(), config); assertFalse(exports.contains(",,")); }
@Test public void testDetermineExportsIncludeServiceInterfaces() { List<HostComponentRegistration> regs = new ArrayList<HostComponentRegistration>() {{ add(new MockRegistration(new HashAttributeSet(), AttributeSet.class)); add(new MockRegistration(new DefaultTableModel(), TableModel.class)); }}; String imports = builder.determineExports(regs, new DefaultPackageScannerConfiguration()); assertNotNull(imports); System.out.println(imports.replace(',', '\n')); assertTrue(imports.contains(AttributeSet.class.getPackage().getName())); assertTrue(imports.contains("javax.swing.event")); }