### Question:
ScratchManagerSupport implements ScratchManager, Serializable { @Override public File getScratchDir() { return getScratchDir(""); } ScratchManagerSupport();  ScratchManagerSupport(String root);  ScratchManagerSupport(File root); void setProperties(Properties properties); @Override File getScratchDir(); @Override File getScratchDir(String suffix); @Override File getScratchDir(final Context context, final String scratchDirPrefix); DataService getDataService(); @Override URL getScratchURL(File scratchFile); URL copyFileToScratchAndGetUrl(File source, File scratchDir); URL copyDirectoryToScratchAndGetUrl(File dir, File scratchDir); URL copyDirectoryToScratchAndGetUrl(File dir, File scratchDir, String as); static String getDataUrl();  }### Answer:
@Test public void testGetScratchDir() throws Exception { ScratchManager scratchManager = new ScratchManagerSupport(); File dataDir = new File(DataService.getDataDir()); if(!dataDir.exists()) dataDir.mkdirs(); for(File f : dataDir.listFiles()) { if(f.getName().startsWith(ScratchManagerSupport.DEFAULT_SCRATCH_DIR)) { if(deleteDirectory(f)) System.out.println("Removed "+f.getName()); } } for(int i=0; i<10; i++) scratchManager.getScratchDir(); int count = 0; for(File f : dataDir.listFiles()) { if(f.getName().startsWith(ScratchManagerSupport.DEFAULT_SCRATCH_DIR)) { count++; } } Assert.assertTrue("Expected 10, got "+count, count==10); }