@Override
    public void trash(final Local file) throws LocalAccessDeniedException {
        synchronized(NSWorkspace.class) {
            if(log.isDebugEnabled()) {
                log.debug(String.format("Move %s to Trash", file));
            }
            // Asynchronous operation. 0 if the operation is performed synchronously and succeeds, and a positive
            // integer if the operation is performed asynchronously and succeeds
            if(!workspace.performFileOperation(
                NSWorkspace.RecycleOperation,
                new NFDNormalizer().normalize(file.getParent().getAbsolute()).toString(), StringUtils.EMPTY,
                NSArray.arrayWithObject(new NFDNormalizer().normalize(file.getName()).toString()))) {
                throw new LocalAccessDeniedException(String.format("Failed to move %s to Trash", file.getName()));
            }
        }
    }
@Test
    public void testTrashRepeated() throws Exception {
        final WorkspaceTrashFeature f = new WorkspaceTrashFeature();
        Local l = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
        new DefaultLocalTouchFeature().touch(l);
        assertTrue(l.exists());
        f.trash(l);
        assertFalse(l.exists());
    }