* update the testcase with.
*/
private List<FileInfo> updateCache(List<FileInfo> newFiles) {
List<FileInfo> replace = Lists.newArrayList();
for (FileInfo file : newFiles) {
FileInfo oldFile = files.getFile(file.getDisplayPath());
if (oldFile == null) {
files.addFile(file);
logger.debug("adding {}", file.getDisplayPath());
} else if (oldFile.shouldReplaceWith(file)) {
logger.debug("replacing {}", oldFile.getDisplayPath());
files.addFile(file);
} else if (file.isLoaded()) {
logger.debug("updating {} (loaded)", file.getDisplayPath());
files.addFile(file);
} else if (oldFile.isLoaded() && !file.isLoaded()){
logger.debug("not replacing {}", file.getDisplayPath());
// the old file the same as the new, except the old is loaded.
replace.add(oldFile);
} else {
logger.debug("files are equal {}", file.getDisplayPath());