// Path: src/test/java/org/neo4j/index/Neo4jTestCase.java
// public static <T> void assertContains( Collection<T> collection,
//     T... expectedItems )
// {
//     String collectionString = join( ", ", collection.toArray() );
//     assertEquals( collectionString, expectedItems.length,
//         collection.size() );
//     for ( T item : expectedItems )
//     {
//         assertTrue( collection.contains( item ) );
//     }
// }
// 
// Path: src/test/java/org/neo4j/index/impl/lucene/Contains.java
// @Factory
// public static <T> Contains<T> contains( T... expectedItems )
// {
//     return new Contains<T>( expectedItems );
// }


import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.index.Index;
import org.neo4j.graphdb.index.IndexHits;
import org.neo4j.test.ImpermanentGraphDatabase;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.neo4j.index.Neo4jTestCase.assertContains;
import static org.neo4j.index.impl.lucene.Contains.contains;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
        index.delete();
        restartTx();

        index = graphDb.index().forNodes( INDEX_NAME );
        key = "key";

        value = "my own value";
        node = graphDb.createNode();
        index.add( node, key, value );
        workers = new ArrayList<WorkThread>();
    }

    public void beginTx()
    {
        if ( tx == null )
        {
            tx = graphDb.beginTx();
        }
    }

    void restartTx()
    {
        finishTx( true );
        beginTx();
    }

    @Test
    public void shouldBeAbleToDeleteAndRecreateIndex()
    {
        restartTx();
// Path: src/test/java/org/neo4j/index/Neo4jTestCase.java
// public static <T> void assertContains( Collection<T> collection,
//     T... expectedItems )
// {
//     String collectionString = join( ", ", collection.toArray() );
//     assertEquals( collectionString, expectedItems.length,
//         collection.size() );
//     for ( T item : expectedItems )
//     {
//         assertTrue( collection.contains( item ) );
//     }
// }
// 
// Path: src/test/java/org/neo4j/index/impl/lucene/Contains.java
// @Factory
// public static <T> Contains<T> contains( T... expectedItems )
// {
//     return new Contains<T>( expectedItems );
// }


// Path: src/test/java/org/neo4j/index/impl/lucene/TestIndexDeletion.java
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.index.Index;
import org.neo4j.graphdb.index.IndexHits;
import org.neo4j.test.ImpermanentGraphDatabase;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.neo4j.index.Neo4jTestCase.assertContains;
import static org.neo4j.index.impl.lucene.Contains.contains;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;

        index.delete();
        restartTx();

        index = graphDb.index().forNodes( INDEX_NAME );
        key = "key";

        value = "my own value";
        node = graphDb.createNode();
        index.add( node, key, value );
        workers = new ArrayList<WorkThread>();
    }

    public void beginTx()
    {
        if ( tx == null )
        {
            tx = graphDb.beginTx();
        }
    }

    void restartTx()
    {
        finishTx( true );
        beginTx();
    }

    @Test
    public void shouldBeAbleToDeleteAndRecreateIndex()
    {
        restartTx();
        assertContains( index.query( key, "own" ) );