### Question:
ReportDate implements Serializable { public Date getCalculatedValue() { value = null; return getValue(); } ReportDate();  ReportDate(Date date);  ReportDate(DateValueType valueType); DateValueType getValueType(); void setValueType(DateValueType valueType); Date getDate(); void setDate(Date date); Date getValue(); void setValue(Date value); Date getCalculatedValue(); void calcDates(); List<DateValueType> getValueTypes();  }### Answer:
@Test public void testSerialization() throws IOException, ClassNotFoundException { System.out.println("getValueType"); ReportDate instance = new ReportDate(DateValueType.Today); ByteArrayOutputStream os = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(os); oos.writeObject(instance); byte[] bytes = os.toByteArray(); ByteArrayInputStream is = new ByteArrayInputStream( bytes); ObjectInputStream ois = new ObjectInputStream(is); ReportDate si = (ReportDate) ois.readObject(); Date expResult = (new LocalDate()).toDate(); Date result = si.getCalculatedValue(); assertEquals(expResult, result); }
@Test public void testGetToday() { System.out.println("getToDay"); ReportDate instance = new ReportDate(DateValueType.Today); Date expResult = (new LocalDate()).toDate(); Date result = instance.getCalculatedValue(); assertEquals(expResult, result); }
@Test public void testGetTomorrow() { System.out.println("getTomorrow"); ReportDate instance = new ReportDate(DateValueType.Tomorrow); Date expResult = (new LocalDate()).plusDays(1).toDate(); Date result = instance.getCalculatedValue(); assertEquals(expResult, result); }