### Question:
SimpleGarbageCollector extends AbstractServer implements Iface { boolean moveToTrash(Path path) throws IOException { final VolumeManager fs = getContext().getVolumeManager(); if (!isUsingTrash()) { return false; } try { return fs.moveToTrash(path); } catch (FileNotFoundException ex) { return false; } } SimpleGarbageCollector(ServerOpts opts, String[] args); static void main(String[] args); @Override @SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit") void run(); @Override GCStatus getStatus(TInfo info, TCredentials credentials); GcCycleMetrics getGcCycleMetrics();  }### Answer:
@Test public void testMoveToTrash_UsingTrash() throws Exception { Path path = createMock(Path.class); expect(volMgr.moveToTrash(path)).andReturn(true); replay(volMgr); assertTrue(gc.moveToTrash(path)); verify(volMgr); }
@Test public void testMoveToTrash_UsingTrash_VolMgrFailure() throws Exception { Path path = createMock(Path.class); expect(volMgr.moveToTrash(path)).andThrow(new FileNotFoundException()); replay(volMgr); assertFalse(gc.moveToTrash(path)); verify(volMgr); }
@Test public void testMoveToTrash_NotUsingTrash() throws Exception { systemConfig.set(Property.GC_TRASH_IGNORE.getKey(), "true"); Path path = createMock(Path.class); assertFalse(gc.moveToTrash(path)); }