AddTwoNum { public int mainFlow(Reader in) throws IOException { BufferedReader br = new BufferedReader(in); int num =0; try{ num = Integer.parseInt(br.readLine()); } catch(NumberFormatException iexc){ System.out.println("Wrong numeric"); } return num; }  static void main(String[] args); int mainFlow(Reader in); int addNumeric(int first,int second);  }
@Test public void WhenPutInFlowIntThanGetItFromFlow() throws IOException { AddTwoNum obj = new AddTwoNum(); System.setIn(new StringBufferInputStream("1")); int result = obj.mainFlow(new InputStreamReader(System.in)); int message = 1; Assert.assertThat(result,is(message)); }