I don't understand why this won't verify. I have tested it and it works perfectly.
Here are the files created. As you can see the second and third files are added to the first.
So I don't understand the messages in the verification.


package com.codegym.task.task18.task1818;
/*
Two in one
Read 3 file names from the console.
Write the contents of the second file to the first file, and then append the contents of the third file to the first file.
Close the streams.
Requirements:
1. The program should read a file name three times from the console.
2. Create an output stream for the first file. For the other two, create input streams.
3. The contents of the second file must be copied to the first file.
4. The contents of the third file must be appended to the first file (after the second file has been written to the first file).
5. The file streams must be closed.
*/
import java.io.*;
import java.nio.channels.FileChannel;
public class Solution {
public static void main(String[] args) throws IOException, FileNotFoundException {
BufferedReader re = new BufferedReader(new InputStreamReader(System.in));
String f1 = re.readLine();
String f2 = re.readLine();
String f3 = re.readLine();
re.close();
FileOutputStream fOut = new FileOutputStream(f1);
FileInputStream fIn1 = new FileInputStream(f2);
FileInputStream fIn2 = new FileInputStream(f3);
FileChannel fChOut = fOut.getChannel();
FileChannel inCh1 = fIn1.getChannel();
inCh1.transferTo(0,inCh1.size(),fChOut);
inCh1.close();
fIn1.close();
FileChannel inCh2 = fIn2.getChannel();
inCh2.transferTo(0,inCh2.size(),fChOut);
inCh2.close();
fIn2.close();
fChOut.close();
fOut.close();
/*
byte[] fileIn1 = new byte[fIn1.available()];
byte[] fileIn2 = new byte[fIn2.available()];
while (fIn1.available() > 0) {
fIn1.read(fileIn1);
}
for (int i = 0; i < fileIn1.length; i++){
fOut.write(fileIn1[i]);
}
while (fIn2.available() > 0) {
fIn2.read(fileIn2);
}
for (int i = 0; i < fileIn2.length; i++){
fOut.write(fileIn2[i],fileIn1.length);
}
*/
}
}