### Question:
DateCheckpointType implements CheckpointType { @Override public Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context) { final String datePattern = getDatePattern(context); final String lastCheckpoint = context.get("lastCheckpoint"); int isValid = 0; try { final Date lastCheckpointAsDate = new SimpleDateFormat(datePattern).parse(lastCheckpoint); final Date currentCheckpointAsDate = new SimpleDateFormat(datePattern).parse((String) currentCheckpoint); isValid = currentCheckpointAsDate.compareTo(lastCheckpointAsDate); } catch (ParseException e) { e.printStackTrace(); } return isValid > 0; }  @Override String buildFilter(Object fieldValue, Map<String, String> context); @Override String buildDefaultFilter(Map<String, String> context); @Override Boolean isValidCurrentCheckpoint(Object currentCheckpoint, Map<String, String> context); @Override Object parseFilter(Object o, Map<String, String> context);  }### Answer:
@Test public void testIsValidCurrentCheckpoint() throws Exception { Boolean filter = dateCheckpointType.isValidCurrentCheckpoint(currentCheckPoint, context); Assert.assertNotNull(filter); }
@Test(expected = ParseException.class) public void testIsNotValidCurrentCheckpoint() throws Exception { Boolean filter = dateCheckpointType.isValidCurrentCheckpoint(currentBadCheckPoint, context); }