Schedule { @Override public boolean equals(Object that) { if (this == that) { return true; } if (!(that instanceof Schedule)) return false; Schedule _that = (Schedule) that; return this.name.equals(_that.name) && this.jobClass.equals(_that.jobClass) && this.frequency.equals(_that.frequency) && this.startTime.equals(_that.startTime) && this.views.equals(_that.views); } Schedule(Class<? extends SchedulableJob> jobClass, String name, String frequency,
           Instant startTime, Map<String,ViewTemplate> views); Class<? extends SchedulableJob> getJobClass(); String getFrequency(); String getName(); Instant getStartTime(); Map<String,ViewTemplate> getViewTemplates(); static Schedule parseJson(String json); String toString(); @Override boolean equals(Object that); @Override int hashCode();  }
@Test public void testEquality() { Instant startTime = Instant.parse("2015-06-10T03:00:00.00Z"); Schedule schedule1 = new Schedule.Builder() .jobName("scheduled-input-output") .jobClass(ScheduledInputOutputJob.class) .frequency("0 * * * *") .startAt(startTime) .withInput("source_users", ScheduledInputOutputApp.INPUT_URI_PATTERN, "0 * * * *") .withOutput("target_users", ScheduledInputOutputApp.OUTPUT_URI_PATTERN) .build(); Schedule schedule2 = new Schedule.Builder() .jobName("scheduled-input-output") .frequency("0 * * * *") .jobClass(ScheduledInputOutputJob.class) .startAt(startTime) .withOutput("target_users", ScheduledInputOutputApp.OUTPUT_URI_PATTERN) .withInput("source_users", ScheduledInputOutputApp.INPUT_URI_PATTERN, "0 * * * *") .build(); Schedule unequal = new Schedule.Builder() .jobName("scheduled-input-output") .frequency("0 * * * *") .jobClass(ScheduledInputOutputJob.class) .startAt(startTime) .withOutput("target_users", ScheduledInputOutputApp.OUTPUT_URI_PATTERN) .withInput("source_users", ScheduledInputOutputApp.INPUT_URI_PATTERN, "1 * * * *") .build(); assertEquals(schedule1, schedule2); assertFalse(schedule1.equals(unequal)); }