### Question:
ExportsBuilder { void constructAutoExports(StringBuilder sb, Collection<ExportPackage> packageExports) { for (ExportPackage pkg : packageExports) { sb.append(pkg.getPackageName()); if (pkg.getVersion() != null) { try { Version.parseVersion(pkg.getVersion()); sb.append(";version=").append(pkg.getVersion()); } catch (IllegalArgumentException ex) { log.info("Unable to parse version: " + pkg.getVersion()); } } sb.append(","); } }  String getExports(List<HostComponentRegistration> regs, PackageScannerConfiguration packageScannerConfig); @SuppressWarnings({"UnusedDeclaration"}) String determineExports(List<HostComponentRegistration> regs, PackageScannerConfiguration packageScannerConfig, File cacheDir);  }### Answer:
@Test public void testConstructAutoExports() { List<ExportPackage> exports = new ArrayList<ExportPackage>(); exports.add(new ExportPackage("foo.bar", "1.0", new File("/whatever/foobar-1.0.jar"))); exports.add(new ExportPackage("foo.bar", "1.0-asdf-asdf", new File("/whatever/foobar-1.0-asdf-asdf.jar"))); StringBuilder sb = new StringBuilder(); builder.constructAutoExports(sb, exports); assertEquals("foo.bar;version=1.0,foo.bar,", sb.toString()); }