PregnancyDetails { public boolean isLastMonthOfPregnancy() { return isLastMonthOfPregnancy; } PregnancyDetails(String monthsPregnant, String edd, int daysPastEdd); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); boolean isLastMonthOfPregnancy();  }
@Test public void isLastMonthOfPregnancy() throws Exception { PregnancyDetails pregnancyDetails = new PregnancyDetails("8", "2012-09-17", 0); assertTrue(pregnancyDetails.isLastMonthOfPregnancy()); pregnancyDetails = new PregnancyDetails("7", "2012-09-17", 0); assertFalse(pregnancyDetails.isLastMonthOfPregnancy()); }