### Question:
FSCheckpointService implements CheckpointService { @Override public boolean delete(CheckpointID id) throws IOException, InterruptedException { if (!(id instanceof FSCheckpointID)) { throw new IllegalArgumentException( "Mismatched checkpoint type: " + id.getClass()); } Path tmp = ((FSCheckpointID)id).getPath(); try { return fs.delete(tmp, false); } catch (FileNotFoundException e) { } return true; } FSCheckpointService(FileSystem fs, Path base,
      CheckpointNamingService namingPolicy, short replication); CheckpointWriteChannel create(); @Override CheckpointReadChannel open(CheckpointID id); @Override CheckpointID commit(CheckpointWriteChannel ch); @Override void abort(CheckpointWriteChannel ch); @Override boolean delete(CheckpointID id);  }### Answer:
@Test public void testDelete() throws Exception { FileSystem fs = mock(FileSystem.class); Path chkloc = new Path("/chk/chk0"); when(fs.delete(eq(chkloc), eq(false))).thenReturn(true); Path base = new Path("/otherchk"); FSCheckpointID id = new FSCheckpointID(chkloc); FSCheckpointService chk = new FSCheckpointService(fs, base, new SimpleNamingService("chk0"), (short) 1); assertTrue(chk.delete(id)); verify(fs).delete(eq(chkloc), eq(false)); }