### Question:
MyPlacesShapeFileExporter extends AbstractMyPlacesExporter { @Override public Collection<? extends File> getExportFiles(File file) { String path = file.getAbsolutePath().toLowerCase(); boolean found = false; String[] extensions = getMimeType().getFileExtensions(); for (String extension : extensions) { if (path.endsWith("." + extension)) { found = true; break; } } String base = found ? file.getAbsolutePath().substring(0, file.getAbsolutePath().length() - 4) : file.getAbsolutePath(); Collection<File> results = New.collection(4); results.add(found ? file : new File(base + ESRIShapefile.POSTFIX_SHP)); results.add(new File(base + ESRIShapefile.POSTFIX_DBF)); results.add(new File(base + ESRIShapefile.POSTFIX_PRJ)); results.add(new File(base + ESRIShapefile.POSTFIX_SHX)); return results; }  @Override File export(File file); @Override Collection<? extends File> getExportFiles(File file); @Override MimeType getMimeType();  }### Answer:
@Test public void testGetExportFiles1() { String path1 = "Path/To A/File"; Collection<? extends File> actual = new MyPlacesShapeFileExporter().getExportFiles(new File(path1)); Assert.assertEquals(4, actual.size()); for (String extension : new String[] { ".shp", ".prj", ".shx", ".dbf" }) { boolean found = false; for (File file : actual) { if (file.getAbsolutePath().endsWith(extension)) { found = true; break; } } Assert.assertTrue("Extension " + extension + " was not found.", found); } }
@Test public void testGetExportFiles2() { String path1 = "Path/To A/File.SHP"; Collection<? extends File> actual = new MyPlacesShapeFileExporter().getExportFiles(new File(path1)); Assert.assertEquals(4, actual.size()); for (String extension : new String[] { ".SHP", ".prj", ".shx", ".dbf" }) { boolean found = false; for (File file : actual) { if (file.getAbsolutePath().endsWith(extension)) { found = true; break; } } Assert.assertTrue("Extension " + extension + " was not found.", found); } }