### Question:
Classroom { public void addX(String name) { students.add(name); } Classroom(); void addX(String name); List<String> getStudents(); void setStudents(List<String> students); public List<String> students; }### Answer:
@Test void test001() { Classroom classroom = new Classroom(); classroom.students = mock(List.class); classroom.addX("IrfanView"); verify(classroom.students, times(1)) .add("IrfanView"); }