Is there any way to unit-test these methods, since they are not taking any parameters and dont return anything i dont know how i
import java.io.*; public class readnWriteFile { String[] names = {"me", "you", "him", "her"}; public void writeFiles(){ BufferedWriter buff; try { buff = new BufferedWriter(new FileWriter("justsomefile.txt")); buff.write("write to this file"); for (String name : names) { buff.write("\n" + name); } buff.close(); } catch (IOException e) { throw new RuntimeException(e); } } public void readFiles(){ try { BufferedReader reader = new BufferedReader(new FileReader("justsomefile.txt")); String line; while((line = reader.readLine()) != null){ System.out.println(line); } reader.close(); } catch (IOException e) { throw new RuntimeException(e); } } }