### Question:
AddMashine { public void add(Long value) { this.value += value; this.addedNumbers++; } AddMashine(Long initialValue); void add(Long value); void sub(Long value); Long getSum(); BigDecimal getAverage();  }### Answer:
@Test public void addTest() { AddMashine sut = new AddMashine(1L); sut.add(1L); sut.add(2L); assertThat(sut.getSum(), is(4L)); }
@Test public void addNullExpectedNullPointerException() { AddMashine sut = new AddMashine(0L); try { sut.add(null); throw new RuntimeException("An exception is expected"); }catch(NullPointerException e) { } }