### Question:
AbstractCciFileType implements FileType { @Override public final Date parseDate(String filename) throws ParseException { final String dateString = filename.substring(0, 8); return TimeUtil.parseInsituFileNameDateFormat(dateString); }  @Override final Date parseDate(String filename); @Override final Date readDate(NetcdfFile datafile); @Override final GridDef getGridDef(); @Override final String getRdac(); @Override final CellFactory<SpatialAggregationCell> getSpatialAggregationCellFactory(AggregationContext context); @Override final CellFactory<CellAggregationCell<AggregationCell>> getMultiMonthAggregationCellFactory(); @Override CellFactory<SpatialAggregationCell> getSingleDayAggregationCellFactory(AggregationContext aggregationContext); static final GridDef GRID_DEF; }### Answer:
@Test public void testParseDate() throws Exception { final File file = new File("20100701000000-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.0.nc"); assertEquals(TimeUtil.parseShortUtcFormat("2010-07-01"), fileType.parseDate(file.getName())); final File file1 = new File("20121201000000-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.0.nc"); assertEquals(TimeUtil.parseShortUtcFormat("2012-12-01"), fileType.parseDate(file1.getName())); final File file2 = new File("19950731000000-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.0.nc"); assertEquals(TimeUtil.parseShortUtcFormat("1995-07-31"), fileType.parseDate(file2.getName())); final File file3 = new File("19950731000000-ESACCI-L4_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.0.nc"); assertEquals(TimeUtil.parseShortUtcFormat("1995-07-31"), fileType.parseDate(file3.getName())); try { final File file4 = new File("ATS_AVG_3PAARC_20020915_D_nD3b.nc.gz"); fileType.parseDate(file4.getName()); fail("ParseException expected."); } catch (ParseException e) { } try { final File file4 = new File("A20100701000000-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.0.nc"); fileType.parseDate(file4.getName()); fail("ParseException expected."); } catch (ParseException e) { } }