JobDiff { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("replacedInstances", getReplacedInstances()) .add("replacementInstances", getReplacementInstances()) .add("unchangedInstances", getUnchangedInstances()) .toString(); } JobDiff(
      Map<Integer, ITaskConfig> replacedInstances,
      Set<Integer> replacementInstances,
      Map<Integer, ITaskConfig> unchangedInstances); Map<Integer, ITaskConfig> getReplacedInstances(); Set<Integer> getReplacementInstances(); Map<Integer, ITaskConfig> getUnchangedInstances(); Set<Integer> getOutOfScopeInstances(Set<Integer> scope); boolean isNoop(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); static JobDiff compute(
      TaskStore taskStore,
      IJobKey job,
      Map<Integer, ITaskConfig> proposedState,
      Set<IRange> scope); static Map<Integer, ITaskConfig> asMap(ITaskConfig config, int instanceCount);  }
@Test public void testObjectOverrides() { control.replay(); JobDiff a = new JobDiff( ImmutableMap.of(0, makeTask("job", "echo")), ImmutableSet.of(0), ImmutableMap.of()); JobDiff b = new JobDiff( ImmutableMap.of(0, makeTask("job", "echo")), ImmutableSet.of(0), ImmutableMap.of()); JobDiff c = new JobDiff( ImmutableMap.of(0, makeTask("job", "echo1")), ImmutableSet.of(0), ImmutableMap.of()); JobDiff d = new JobDiff( ImmutableMap.of(0, makeTask("job", "echo")), ImmutableSet.of(1), ImmutableMap.of()); assertEquals(a, b); assertEquals(ImmutableSet.of(a), ImmutableSet.of(a, b)); assertNotEquals(a, c); assertNotEquals(a, "a string"); assertNotEquals(a, d); assertEquals(a.toString(), b.toString()); }