### Question:
SaleTier { public StatusType getStatusAtDate(Date date) { StatusType status; if (this.getEndDate().compareTo(date) <= 0) { status = StatusType.CLOSED; } else if (this.getStartDate().compareTo(date) <= 0 && this.getEndDate().compareTo(date) > 0) { if (this.getTomicsSold().compareTo(this.getTomicsMax()) >= 0) { status = StatusType.CLOSED; } else { status = StatusType.ACTIVE; } } else { status = StatusType.INCOMING; } return status; } SaleTier(long tierNo, String description, Date startDate, Date endDate, BigDecimal discount,
                    BigInteger tomicsSold, BigInteger tomicsMax, boolean hasDynamicDuration, boolean hasDynamicMax); protected  SaleTier(); long getTierNo(); void setTierNo(int tierNo); String getDescription(); void setDescription(String description); Date getStartDate(); void setStartDate(Date startDate); Date getEndDate(); void setEndDate(Date endDate); BigDecimal getDiscount(); void setDiscount(BigDecimal discount); BigInteger getTomicsSold(); void setTomicsSold(BigInteger tomicsSold); BigInteger getTomicsMax(); void setTomicsMax(BigInteger tomicsMax); boolean hasDynamicDuration(); void setHasDynamicDuration(boolean hasDynamicDuration); boolean hasDynamicMax(); void setHasDynamicMax(boolean hasDynamicMax); boolean isFull(); boolean isAmountOverflowingTier(BigInteger tomics); BigInteger getRemainingTomics(); StatusType getStatusAtDate(Date date);  }### Answer:
@Test public void testGetStatusAtDate() { SaleTier t = createTier(0, "1970-01-03", "1970-01-06", BigDecimal.ZERO, BigInteger.TEN, true, false); Date date = Date.valueOf("1970-01-02"); assertEquals(t.getStatusAtDate(date), StatusType.INCOMING); date = Date.valueOf("1970-01-03"); assertEquals(t.getStatusAtDate(date), StatusType.ACTIVE); date = Date.valueOf("1970-01-04"); assertEquals(t.getStatusAtDate(date), StatusType.ACTIVE); date = Date.valueOf("1970-01-06"); assertEquals(t.getStatusAtDate(date), StatusType.CLOSED); date = Date.valueOf("1970-01-07"); assertEquals(t.getStatusAtDate(date), StatusType.CLOSED); t.setTomicsSold(BigInteger.TEN); date = Date.valueOf("1970-01-04"); assertEquals(t.getStatusAtDate(date), StatusType.CLOSED); t.setTomicsSold(BigInteger.TEN.add(BigInteger.TEN)); date = Date.valueOf("1970-01-04"); assertEquals(t.getStatusAtDate(date), StatusType.CLOSED); t = createTier(0, "1970-01-03", "1970-01-06", BigDecimal.ZERO, BigInteger.ZERO, false, true); t.setTomicsSold(BigInteger.TEN); date = Date.valueOf("1970-01-02"); assertEquals(t.getStatusAtDate(date), StatusType.INCOMING); date = Date.valueOf("1970-01-03"); assertEquals(t.getStatusAtDate(date), StatusType.CLOSED); }