// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/registry/FileChangeRegistry.java
// public enum EventType {
//     CHANGE,
//     DELETED,
//     NEW_CHILD
// }
// 
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/registry/FileChangeRegistry.java
// public interface FileObserver {
//     public void onEvent ( EventType type, String path );
// }


import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
import org.openide.filesystems.FileUtil;
import org.openide.util.Lookup;
import org.openide.util.lookup.Lookups;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;
import org.netbeans.api.project.Project;
import org.netbeans.modules.nodejs.registry.FileChangeRegistry.EventType;
import org.netbeans.modules.nodejs.registry.FileChangeRegistry.FileObserver;
import org.openide.filesystems.FileLock;
        List<EventType> l = oSub.await();
        assertFalse( l.isEmpty() );
        assertEquals( 1, l.size() );
        assertEquals( EventType.NEW_CHILD, l.iterator().next() );
        Thread.sleep( FileChangeRegistry.DEFAULT_DELAY * 2 );
        l = oRoot.await();
        assertFalse( l.isEmpty() );
        assertEquals( EventType.NEW_CHILD, l.iterator().next() );
        assertTrue( oa.evts.isEmpty() );
        assertTrue( ob.evts.isEmpty() );
        assertTrue( oc.evts.isEmpty() );
        assertTrue( od.evts.isEmpty() );

        c.delete();
        l = oc.await();
        assertFalse( l.isEmpty() );
        assertEquals( EventType.DELETED, l.iterator().next() );

        projectRoot.delete();
        l = oRoot.await();
        Thread.sleep( FileChangeRegistry.DEFAULT_DELAY * 2 );

        assertFalse( l.isEmpty() );
        assertFalse( oSub.evts.isEmpty() );
        assertFalse( oa.evts.isEmpty() );
        assertFalse( ob.evts.isEmpty() );
        assertFalse( oc.evts.isEmpty() );
        assertFalse( od.evts.isEmpty() );
    }

// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/registry/FileChangeRegistry.java
// public enum EventType {
//     CHANGE,
//     DELETED,
//     NEW_CHILD
// }
// 
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/registry/FileChangeRegistry.java
// public interface FileObserver {
//     public void onEvent ( EventType type, String path );
// }


// Path: node-projects/src/test/java/org/netbeans/modules/nodejs/registry/FileChangeRegistryTest.java
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
import org.openide.filesystems.FileUtil;
import org.openide.util.Lookup;
import org.openide.util.lookup.Lookups;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;
import org.netbeans.api.project.Project;
import org.netbeans.modules.nodejs.registry.FileChangeRegistry.EventType;
import org.netbeans.modules.nodejs.registry.FileChangeRegistry.FileObserver;
import org.openide.filesystems.FileLock;

        List<EventType> l = oSub.await();
        assertFalse( l.isEmpty() );
        assertEquals( 1, l.size() );
        assertEquals( EventType.NEW_CHILD, l.iterator().next() );
        Thread.sleep( FileChangeRegistry.DEFAULT_DELAY * 2 );
        l = oRoot.await();
        assertFalse( l.isEmpty() );
        assertEquals( EventType.NEW_CHILD, l.iterator().next() );
        assertTrue( oa.evts.isEmpty() );
        assertTrue( ob.evts.isEmpty() );
        assertTrue( oc.evts.isEmpty() );
        assertTrue( od.evts.isEmpty() );

        c.delete();
        l = oc.await();
        assertFalse( l.isEmpty() );
        assertEquals( EventType.DELETED, l.iterator().next() );

        projectRoot.delete();
        l = oRoot.await();
        Thread.sleep( FileChangeRegistry.DEFAULT_DELAY * 2 );

        assertFalse( l.isEmpty() );
        assertFalse( oSub.evts.isEmpty() );
        assertFalse( oa.evts.isEmpty() );
        assertFalse( ob.evts.isEmpty() );
        assertFalse( oc.evts.isEmpty() );
        assertFalse( od.evts.isEmpty() );
    }

    private static class O implements FileObserver {