### Question:
DonatedOrgan { public double getProgressDecimal() { Duration timeToExpiry = getDurationUntilExpiry(); Duration expiration = getOrganType().getMaxExpiration(); if (timeToExpiry == null) { return -1; } else if (timeToExpiry.isZero()) { return 1; } else { return 1 - (double) timeToExpiry.getSeconds() / expiration.getSeconds(); } } protected  DonatedOrgan();  DonatedOrgan(Organ organType, Client donor, LocalDateTime dateTimeOfDonation);  DonatedOrgan(Organ organType, Client donor, LocalDateTime dateTimeOfDonation, Long id); static Comparator<DonatedOrgan> getComparator(DonatedOrganSortOptionsEnum sortOption); Organ getOrganType(); Client getDonor(); void setDonor(Client donor); Client getReceiver(); void setReceiver(Client receiver); LocalDateTime getDateTimeOfDonation(); void setDateTimeOfDonation(LocalDateTime dateTimeOfDonation); boolean hasExpired(); boolean hasExpiredNaturally(); Duration getDurationUntilExpiry(); double getProgressDecimal(); double getFullMarker(); Long getId(); void setId(long id); boolean isAvailable(); void setAvailable(boolean available); String getOverrideReason(); @JsonIgnore String getRawOverrideReason(); void manuallyOverride(String overrideReason); void cancelManualOverride(); OrganState getState(); OrganState getState(boolean includeTransplantStatus); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void getProgressDecimalTest() { donatedOrgan = new DonatedOrgan(organ, donor, dateTimeOfDonation); assertEquals(0, donatedOrgan.getProgressDecimal(), 1e-3); }
@Test public void getProgressDecimalNotInLowerBoundTest() { dateTimeOfDonation = LocalDateTime.now().minusHours(3); donatedOrgan = new DonatedOrgan(organ, donor, dateTimeOfDonation); assertEquals(0.5, donatedOrgan.getProgressDecimal(), 1e-3); }
@Test public void getProgressDecimalInLowerBoundTest() { dateTimeOfDonation = LocalDateTime.now().minusHours(5); donatedOrgan = new DonatedOrgan(organ, donor, dateTimeOfDonation); assertEquals((double) 5 / 6, donatedOrgan.getProgressDecimal(), 1e-3); }
@Test public void getProgressDecimalJustExpiredTest() { dateTimeOfDonation = LocalDateTime.now().minusHours(6); donatedOrgan = new DonatedOrgan(organ, donor, dateTimeOfDonation); assertEquals(1, donatedOrgan.getProgressDecimal(), 1e-3); }
@Test public void getProgressDecimalExpiredTest() { dateTimeOfDonation = LocalDateTime.now().minusHours(7); donatedOrgan = new DonatedOrgan(organ, donor, dateTimeOfDonation); assertEquals(1, donatedOrgan.getProgressDecimal(), 1e-3); }