/**
* Constructs the mock file tree used in each of the tests.
*/
public static DirInfo createMockTree(NodeInfoFactory nodeInfoFactory) {
// Root has 3 directories and 2 files.
DirInfo root = makeEmptyDir(nodeInfoFactory, "Root");
// This has only files. This subtree is 1 level deep.
DirInfo AD1 = makeEmptyDir(nodeInfoFactory, "AD1");
AD1.getFiles().add(makeFile(nodeInfoFactory, "AF2"));
AD1.getFiles().add(makeFile(nodeInfoFactory, "BF2"));
AD1.getFiles().add(makeFile(nodeInfoFactory, "CF2"));
AD1.getFiles().add(makeFile(nodeInfoFactory, "DF2"));
// This has mixed files and empty directories. this subtree is 1 level deep.
DirInfo BD1 = makeEmptyDir(nodeInfoFactory, "BD1");
BD1.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "AD2"));
BD1.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "BD2"));
BD1.getFiles().add(makeFile(nodeInfoFactory, "EF2"));
BD1.getFiles().add(makeFile(nodeInfoFactory, "FF2"));
BD1.getFiles().add(makeFile(nodeInfoFactory, "GF2"));
// This has mixed files and directories. The directories then have subfiles.
// 2 levels deep.
DirInfo CD1 = makeEmptyDir(nodeInfoFactory, "CD1");
CD1.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "CD2"));
CD1.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "DD2"));
CD1.getFiles().add(makeFile(nodeInfoFactory, "HF2"));
CD1.getFiles().add(makeFile(nodeInfoFactory, "IF2"));
CD1.getFiles().add(makeFile(nodeInfoFactory, "JF2"));
// We must go deeper.
DirInfo CD2 = CD1.getSubDirectories().get(0);
CD2.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "AD3"));
CD2.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "BD3"));
CD2.getFiles().add(makeFile(nodeInfoFactory, "AF3"));
CD2.getFiles().add(makeFile(nodeInfoFactory, "BF3"));
CD2.getFiles().add(makeFile(nodeInfoFactory, "CF3"));
DirInfo DD2 = CD1.getSubDirectories().get(1);
DD2.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "CD3"));
DD2.getSubDirectories().add(makeEmptyDir(nodeInfoFactory, "DD3"));
DD2.getFiles().add(makeFile(nodeInfoFactory, "DF3"));
DD2.getFiles().add(makeFile(nodeInfoFactory, "EF3"));
DD2.getFiles().add(makeFile(nodeInfoFactory, "FF3"));
// Add them to the root and return it.
root.getSubDirectories().add(AD1);
root.getSubDirectories().add(BD1);
root.getSubDirectories().add(CD1);