@Test public void whenOddNumberThreeInStreamThenResultFalse() { EvenNumber number = new EvenNumber(); try (ByteArrayInputStream stream = new ByteArrayInputStream("3".getBytes())) { assertThat(number.isNumber(stream), is(false)); } catch (IOException ioe) { ioe.printStackTrace(); } }
public boolean isNumber(InputStream in) { boolean result = false; Scanner sc = new Scanner(in); while (sc.hasNextInt()) { if (sc.nextInt() % 2 == 0) { result = true; } } return result; }
EvenNumber { public boolean isNumber(InputStream in) { boolean result = false; Scanner sc = new Scanner(in); while (sc.hasNextInt()) { if (sc.nextInt() % 2 == 0) { result = true; } } return result; } }
EvenNumber { public boolean isNumber(InputStream in) { boolean result = false; Scanner sc = new Scanner(in); while (sc.hasNextInt()) { if (sc.nextInt() % 2 == 0) { result = true; } } return result; }  }
EvenNumber { public boolean isNumber(InputStream in) { boolean result = false; Scanner sc = new Scanner(in); while (sc.hasNextInt()) { if (sc.nextInt() % 2 == 0) { result = true; } } return result; }  boolean isNumber(InputStream in); }
EvenNumber { public boolean isNumber(InputStream in) { boolean result = false; Scanner sc = new Scanner(in); while (sc.hasNextInt()) { if (sc.nextInt() % 2 == 0) { result = true; } } return result; }  boolean isNumber(InputStream in);  }