Program: 47517
Project: 47517
Buggy source:
public void testGetFiles() throws Exception {
{
    final File invalidFile=createTempFile("String_Node_Str");
    assertTrue(invalidFile.delete());
    final FileSolutionRepositoryImportSource importSource=new FileSolutionRepositoryImportSource(invalidFile,"String_Node_Str");
    assertEquals(0,importSource.getCount());
    final Iterable<ImportSource.IRepositoryFileBundle> files=importSource.getFiles();
    assertNotNull(files);
    assertFalse(files.iterator().hasNext());
  }
{
    final File validFile=createTempFile("String_Node_Str");
    final FileSolutionRepositoryImportSource importSource=new FileSolutionRepositoryImportSource(validFile,"String_Node_Str");
    assertEquals(1,importSource.getCount());
    assertNotNull(importSource.getFiles());
    final Iterator<ImportSource.IRepositoryFileBundle> iterator=importSource.getFiles().iterator();
    assertNotNull(iterator);
    final ImportSource.IRepositoryFileBundle file=iterator.next();
    assertNotNull(file);
    iterator.remove();
    assertEquals(0,importSource.getCount());
    assertFalse(iterator.hasNext());
  }
{
    final Map<String,ImportSource.IRepositoryFileBundle> foldersFound=new HashMap<String,ImportSource.IRepositoryFileBundle>();
    final Map<String,ImportSource.IRepositoryFileBundle> filesFound=new HashMap<String,ImportSource.IRepositoryFileBundle>();
    final File sourceFile=new File("String_Node_Str");
    assertTrue("String_Node_Str",sourceFile.exists());
    FileSolutionRepositoryImportSource importSource=new FileSolutionRepositoryImportSource(sourceFile,"String_Node_Str");
    assertEquals(11,importSource.getCount());
    final Iterable<ImportSource.IRepositoryFileBundle> files=importSource.getFiles();
    assertNotNull(files);
    for (Iterator<ImportSource.IRepositoryFileBundle> it=files.iterator(); it.hasNext(); ) {
      final ImportSource.IRepositoryFileBundle bundle=it.next();
      assertNotNull(bundle);
      assertNotNull(bundle.getFile());
      if (bundle.getFile().isFolder()) {
        foldersFound.put(bundle.getFile().getName(),bundle);
      }
 else {
        filesFound.put(bundle.getFile().getName(),bundle);
      }
    }
    assertEquals(8,filesFound.size());
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertNotNull(filesFound.get("String_Node_Str"));
    assertEquals("String_Node_Str",filesFound.get("String_Node_Str").getPath());
    assertEquals(3,foldersFound.size());
    assertNotNull(foldersFound.get("String_Node_Str"));
    assertNotNull(foldersFound.get("String_Node_Str"));
    assertNotNull(foldersFound.get("String_Node_Str"));
    assertEquals("String_Node_Str",foldersFound.get("String_Node_Str").getPath());
  }
}

Fixed version (ground truth):
public void testGetFiles() throws Exception {
{
    final File invalidFile=createTempFile("String_Node_Str");
    assertTrue(invalidFile.delete());
    final FileSolutionRepositoryImportSource importSource=new FileSolutionRepositoryImportSource(invalidFile,"String_Node_Str");
    assertEquals(0,importSource.getCount());
    final Iterable<ImportSource.IRepositoryFileBundle> files=importSource.getFiles();
    assertNotNull(files);
    assertFalse(files.iterator().hasNext());
  }
{
    final File validFile=createTempFile("String_Node_Str");
    final FileSolutionRepositoryImportSource importSource=new FileSolutionRepositoryImportSource(validFile,"String_Node_Str");
    assertEquals(1,importSource.getCount());
    assertNotNull(importSource.getFiles());
    final Iterator<ImportSource.IRepositoryFileBundle> iterator=importSource.getFiles().iterator();
    assertNotNull(iterator);
    final ImportSource.IRepositoryFileBundle file=iterator.next();
    assertNotNull(file);
    iterator.remove();
    assertEquals(0,importSource.getCount());
    assertFalse(iterator.hasNext());
  }
{
    validateImportSource(new File("String_Node_Str"));
    validateImportSource(new File("String_Node_Str"));
    validateImportSource(new File("String_Node_Str"));
    validateImportSource(new File("String_Node_Str"));
    validateImportSource(new File("String_Node_Str").getAbsoluteFile());
  }
}