/** * {@inheritDoc } */ @Override public boolean equals(Object object, ComparisonMode mode) { if (object instanceof Calendar) { final Calendar that = (Calendar) object; return Objects.equals(this.getName(), that.getName()) && Objects.equals(this.getDomainOfValidity(), that.getDomainOfValidity()) && Objects.equals(this.referenceFrame, that.getReferenceFrame()) &&Objects.equals(this.timeBasis, that.getTimeBasis()); } return false; }
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object The Calendar to copy values from, or {@code null} if none. * * @see #castOrCopy(Calendar) * @throws NullArgumentException if referenceFrame is {@code null}. */ private DefaultCalendar(final Calendar object) { super(object); if (object != null) { referenceFrame = object.getReferenceFrame(); ArgumentChecks.ensureNonNull("referenceFrame", referenceFrame); timeBasis = object.getTimeBasis(); } }
/** * Test of getClock method, of class DefaultCalendar. */ @Test public void testGetClock() { Clock result = calendar1.getTimeBasis(); assertEquals(calendar2.getTimeBasis(), result); } //