### Question:
VfsDateRangeFilter extends FileDepthSelector { protected Date parseDateString( String dateString ) throws IllegalArgumentException { if ( dateString == null ) { return null; } try { return format.parse( dateString ); } catch ( ParseException e ) { throw new IllegalArgumentException( Messages.getString( "ERROR.CouldNotParseDateFromString", dateString ), e ); } } VfsDateRangeFilter( SimpleDateFormat format );  VfsDateRangeFilter( SimpleDateFormat format, Date startingDate );  VfsDateRangeFilter( SimpleDateFormat format, String startingDate );  VfsDateRangeFilter( SimpleDateFormat format, Date startingDate, Date endingDate );  VfsDateRangeFilter( SimpleDateFormat format, String startingDate, String endingDate ); Date getEndingDate(); void setEndingDate( Date endingDate ); void setEndingDate( String endingDate ); Date getStartingDate(); void setStartingDate( Date startingDate ); void setStartingDate( String startingDate ); @Override boolean includeFile( FileSelectInfo fileInfo );  }### Answer:
@Test public void testParseDateString() throws Exception { filter = new VfsDateRangeFilter( format ); Date date = filter.parseDateString( start ); assertNotNull( date ); Calendar cal = Calendar.getInstance(); cal.setTime( date ); assertEquals( 2015, cal.get( Calendar.YEAR ) ); assertEquals( Calendar.JULY, cal.get( Calendar.MONTH ) ); assertEquals( 8, cal.get( Calendar.DAY_OF_MONTH ) ); }
@Test public void testParseNullDateString() throws Exception { filter = new VfsDateRangeFilter( format ); Date date = filter.parseDateString( null ); assertNull( date ); }
@Test( expected = IllegalArgumentException.class ) public void testParseInvalidDateString() throws Exception { filter = new VfsDateRangeFilter( format ); Date date = filter.parseDateString( "20159999" ); }