Todo extends SugarRecord implements Serializable { @Override public boolean equals(Object object) { return object instanceof Todo && this.getId().equals(((Todo) object).getId()); } Todo();  Todo(String title, Date dueDate, boolean completed, Priority priority); void switchComplete(); Priority getPriority(); void setPriority(Priority priority); String getTitle(); void setTitle(String title); Date getDueDate(); void setDueDate(Date dueDate); boolean isCompleted(); void setCompleted(boolean completed); @Override boolean equals(Object object);  }
@Test public void testEqualDifferetType() throws Exception { assertFalse(mTodo.equals(new Object())); }
@Test public void testEqual() throws Exception { mTodo.setId(100L); Todo todo = new Todo(); todo.setId(100L); assertTrue(mTodo.equals(todo)); }
@Test public void testNotEqual() throws Exception { mTodo.setId(100L); assertFalse(mTodo.equals(new Todo())); }