JobInvocation implements JobParameters { @Override public int hashCode() { int result = tag.hashCode(); result = 31 * result + service.hashCode(); return result; } private  JobInvocation(Builder builder); @NonNull @Override String getService(); @NonNull @Override String getTag(); @NonNull @Override JobTrigger getTrigger(); @Override int getLifetime(); @Override boolean isRecurring(); @NonNull @Override int[] getConstraints(); @NonNull @Override Bundle getExtras(); @NonNull @Override RetryStrategy getRetryStrategy(); @Override boolean shouldReplaceCurrent(); @Override TriggerReason getTriggerReason(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void contract_hashCode_equals() { JobInvocation jobInvocation = builder.build(); assertEquals(jobInvocation, builder.build()); assertEquals(jobInvocation.hashCode(), builder.build().hashCode()); JobInvocation jobInvocationNew = builder.setTag("new").build(); assertNotEquals(jobInvocation, jobInvocationNew); assertNotEquals(jobInvocation.hashCode(), jobInvocationNew.hashCode()); }
@Test public void contract_hashCode_equals_triggerShouldBeIgnored() { JobInvocation jobInvocation = builder.build(); JobInvocation periodic = builder.setTrigger(Trigger.executionWindow(0, 1)).build(); assertEquals(jobInvocation, periodic); assertEquals(jobInvocation.hashCode(), periodic.hashCode()); }