### Question:
ActivityResult { public boolean isOk() { return resultCode == okResultCode; } 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 isOkTest() throws Exception { ActivityResult faultyResult = new ActivityResult(Activity.RESULT_OK, resultCode - 1, intent); assertFalse(faultyResult.isOk()); ActivityResult okResult = new ActivityResult(Activity.RESULT_OK, Activity.RESULT_OK, intent); assertTrue(okResult.isOk()); }