Task { public boolean isActive() { return !isCompleted(); } Task(String id, String title, String description); protected  Task(String id, String title, String description, boolean completed);  Task(String title, String description); @Override int hashCode(); void active(); void complete(); String getDescription(); void setDescription(String description); String getId(); String getTitle(); void setTitle(String title); boolean isActive(); boolean isCompleted(); void setCompleted(boolean completed);  }
@Test public void testIsActive() throws Exception { Task task = new Task("title", "description"); assertThat(task.isActive(), equalTo(true)); task.complete(); assertThat(task.isActive(), equalTo(false)); }