### Question:
StructuredDirectory { public static File storeFile(File outDir, File inputFile) throws IOException { int docId = parseInt(removeExtension(inputFile.getName())); int[] paths = getSplit(docId); forceMkdir(outDir); File dir1 = new File(outDir, paths[0] + ""); forceMkdir(dir1); File dir2 = new File(dir1, paths[1] + ""); forceMkdir(dir2); String newFileName = paths[2] + "." + getExtension(inputFile.getName()); File newFile = new File(dir2, newFileName); copyFile(inputFile, newFile); return newFile; }  static int[] getSplit(int docId); static File storeFile(File outDir, File inputFile); static int decodeFileName(File inputFile); static int decodeFileName(String inputFile); static String getFilePath(int docId, String extention);  }### Answer:
@Test public void testStoreFile() throws Exception { File outDir = new File("target/testStoreFile"); File inputFile = new File("target/2345678.txt"); inputFile.createNewFile(); File newFile = StructuredDirectory.storeFile(outDir, inputFile); String relativePath = newFile.getAbsolutePath().substring( outDir.getAbsolutePath().length()); relativePath = relativePath.replaceAll("\\\\", "/"); assertEquals("/2/345/678.txt", relativePath); inputFile = new File("target/777.txt"); inputFile.createNewFile(); newFile = StructuredDirectory.storeFile(outDir, inputFile); relativePath = newFile.getAbsolutePath().substring( outDir.getAbsolutePath().length()); relativePath = relativePath.replaceAll("\\\\", "/"); assertEquals("/0/0/777.txt", relativePath); }