@@ -0,0 +1,1336 @@
+package fr.free.nrw.commons;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.io.BufferedInputStream;%0Aimport java.io.BufferedOutputStream;%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0A%0Aimport fr.free.nrw.commons.upload.FileUtils;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0A%0Apublic class FileUtilsTest %7B%0A    @Test public void copiedFileIsIdenticalToSource() throws IOException %7B%0A        File source = File.createTempFile(%22temp%22, %22%22);%0A        File dest = File.createTempFile(%22temp%22, %22%22);%0A        writeToFile(source, %22Hello, World%22);%0A        FileUtils.copy(new FileInputStream(source), new FileOutputStream(dest));%0A        Assert.assertThat(getString(dest), is(getString(source)));%0A    %7D%0A%0A    private static void writeToFile(File file, String s) throws IOException %7B%0A        BufferedOutputStream buf = new BufferedOutputStream(new FileOutputStream(file));%0A        buf.write(s.getBytes());%0A        buf.close();%0A    %7D%0A%0A    private static String getString(File file) throws IOException %7B%0A        int size = (int) file.length();%0A        byte%5B%5D bytes = new byte%5Bsize%5D;%0A        BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));%0A        buf.read(bytes, 0, bytes.length);%0A        buf.close();%0A        return new String(bytes);%0A    %7D%0A%7D%0A

Add test for FileUtils