private Collection<String> readProcessOutput(Process proc) throws IOException {
  BufferedReader rdr=new BufferedReader(new InputStreamReader(proc.getInputStream()));
  Collection<String> res=new ArrayList<>();
  String s;
  while ((s=rdr.readLine()) != null)   res.add(s);
  return res;
}

private Collection < String > readProcessOutput ( Process proc ) throws IOException { BufferedReader rdr = new BufferedReader ( new InputStreamReader ( proc . getInputStream ( ) ) ) ; Collection < String > res = new ArrayList < > ( ) ; String s ; while ( ( s = rdr . readLine ( ) ) != null ) res . add ( s ) ; return res ; }
reads process output line - by - line .
