### Question:
DataSet implements Serializable { public String getPeriod(Date date) { OrderCycle cycle = Helpers.getOrderCycle(getPeriodType()); return cycle.getPeriod(date); } DataSet(String id);  DataSet();  DataSet(String id, String name, String periodType);  DataSet(com.thoughtworks.dhis.models.DataSet rawDataSet); com.thoughtworks.dhis.models.DataSet toRawDataSet(); String getPeriod(Date date); @Override boolean equals(Object o); @Override int hashCode(); String getId(); List<DataElement> getDataElements(); String getName(); void setPeriodType(String periodType); String getPeriodType(); @Override String toString(); static final String ALLOCATED; static final String CALCULATED; static final String DEFAULT; static final String NAME; }### Answer:
@Test public void shouldReturnCorrectPeriodType() throws Exception { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM"); String expectedPeriod = dateFormat.format(new Date()); DataSet dataSet = new DataSet("id", "LMIS Commodities Allocated", "Monthly"); assertThat(dataSet.getPeriod(new Date()), is(expectedPeriod)); }