### Question:
ActivityResult { @Override public boolean equals(Object obj) { if (obj instanceof ActivityResult) { if (this == obj) { return true; } ActivityResult activityResult = (ActivityResult) obj; return activityResult.data == data && activityResult.resultCode == resultCode; } else { return false; } } ActivityResult(int okResultCode, int resultCode, Intent data); Intent getData(); int getResultCode(); boolean isOk(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void equalsTrue() throws Exception { ActivityResult testResult = new ActivityResult(Activity.RESULT_OK, resultCode, intent); assertTrue(activityResult.equals(testResult)); assertTrue(activityResult.equals(activityResult)); }
@Test public void equalsFalse() throws Exception { ActivityResult testResult = new ActivityResult(Activity.RESULT_OK, resultCode - 1, intent); assertFalse(activityResult.equals(testResult)); assertFalse(activityResult.equals(intent)); }