@Test public void equalsFalse() throws Exception { ActivityResult testResult = new ActivityResult(Activity.RESULT_OK, resultCode - 1, intent); assertFalse(activityResult.equals(testResult)); assertFalse(activityResult.equals(intent)); }
@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 { @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 { @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); }
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(); }
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();  }