ReservationTask extends AbstractQueueTask implements AccessControlled { @Override public int hashCode() { return backfill ? Objects.hash(jenkins, taskName) : Objects.hash(jenkins, taskName, label, qid) ; } ReservationTask(@Nonnull ExecutorJenkins owner, @Nonnull Label label, @Nonnull String taskName, long qid);  ReservationTask(@Nonnull ExecutorJenkins owner, @Nonnull String host, boolean backfill); @Override boolean isBuildBlocked(); @Override @Deprecated String getWhyBlocked(); @Override String getName(); @Override String getFullDisplayName(); @Override String getDisplayName(); @Override Label getAssignedLabel(); ExecutorJenkins getOwner(); @Nonnull String getTaskName(); @Override void checkAbortPermission(); @Override boolean hasAbortPermission(); @Nonnull ACL getACL(); final void checkPermission(@Nonnull Permission permission); final boolean hasPermission(@Nonnull Permission permission); Queue.Item schedule(); @Override @Nonnull String getUrl(); @Override ResourceList getResourceList(); @Override Node getLastBuiltOn(); @Override long getEstimatedDuration(); @Override @CheckForNull Queue.Executable createExecutable(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void essentials() { ReservationTask id = new ReservationTask(ACME_EXECUTOR, label("foo"), "bar", 42); assertEquals(id, id); assertEquals(id.hashCode(), id.hashCode()); assertNotEquals(id, new ReservationTask(ACME_EXECUTOR, label("foo"), "bar", 11)); assertNotEquals(id, new ReservationTask(ACME_EXECUTOR, label("foo"), "BUZ", 42)); assertNotEquals(id, new ReservationTask(ACME_EXECUTOR, label("UFO"), "bar", 42)); assertNotEquals(id, new ReservationTask(EMCA_EXECUTOR, label("foo"), "bar", 42)); ReservationTask backfill = new ReservationTask(ACME_EXECUTOR, "foo", true); assertEquals(backfill, backfill); assertEquals(backfill.hashCode(), backfill.hashCode()); assertNotEquals(backfill, new ReservationTask(EMCA_EXECUTOR, "foo", true)); assertNotEquals(backfill, new ReservationTask(ACME_EXECUTOR, "bar", true)); assertNotEquals( new ReservationTask(ACME_EXECUTOR, "host", true), new ReservationTask(ACME_EXECUTOR, label("host"), "host", -1) ); }