Java Code Examples for com.google.common.collect.testing.TestStringSetGenerator

The following examples show how to use com.google.common.collect.testing.TestStringSetGenerator. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cqengine   Source File: ConcurrentIndexedCollectionTest.java    License: Apache License 2.0 5 votes vote down vote up
private static TestStringSetGenerator onHeapIndexedCollectionGenerator() {
    return new TestStringSetGenerator() {
        @Override protected Set<String> create(String[] elements) {
            IndexedCollection<String> indexedCollection = new ConcurrentIndexedCollection<String>(OnHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
            indexedCollection.addAll(asList(elements));
            return indexedCollection;
        }
    };
}
 
Example 2
Source Project: cqengine   Source File: ConcurrentIndexedCollectionTest.java    License: Apache License 2.0 5 votes vote down vote up
private static TestStringSetGenerator offHeapIndexedCollectionGenerator() {
    return new TestStringSetGenerator() {
        @Override protected Set<String> create(String[] elements) {
            IndexedCollection<String> indexedCollection = new ConcurrentIndexedCollection<String>(OffHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
            indexedCollection.addAll(asList(elements));
            return indexedCollection;
        }
    };
}
 
Example 3
private static TestStringSetGenerator onHeapIndexedCollectionGenerator() {
    return new TestStringSetGenerator() {
        @Override protected Set<String> create(String[] elements) {
            IndexedCollection<String> indexedCollection = new TransactionalIndexedCollection<String>(String.class, OnHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
            indexedCollection.addAll(Arrays.asList(elements));
            return indexedCollection;
        }
    };
}
 
Example 4
private static TestStringSetGenerator offHeapIndexedCollectionGenerator() {
    return new TestStringSetGenerator() {
        @Override protected Set<String> create(String[] elements) {
            IndexedCollection<String> indexedCollection = new TransactionalIndexedCollection<String>(String.class, OffHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
            indexedCollection.addAll(Arrays.asList(elements));
            return indexedCollection;
        }
    };
}
 
Example 5
private static TestStringSetGenerator onHeapIndexedCollectionGenerator() {
    return new TestStringSetGenerator() {
        @Override protected Set<String> create(String[] elements) {
            IndexedCollection<String> indexedCollection = new ObjectLockingIndexedCollection<String>(OnHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
            indexedCollection.addAll(Arrays.asList(elements));
            return indexedCollection;
        }
    };
}
 
Example 6
private static TestStringSetGenerator offHeapIndexedCollectionGenerator() {
    return new TestStringSetGenerator() {
        @Override protected Set<String> create(String[] elements) {
            IndexedCollection<String> indexedCollection = new ObjectLockingIndexedCollection<String>(OffHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
            indexedCollection.addAll(Arrays.asList(elements));
            return indexedCollection;
        }
    };
}
 
Example 7
Source Project: JCTools   Source File: SingleWriterHashSetTest.java    License: Apache License 2.0 5 votes vote down vote up
public static Test suite() throws Exception {
    return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override
        protected Set<String> create(String[] elements) {
            Set<String> set = new SingleWriterHashSet<>(elements.length);
            Collections.addAll(set, elements);
            return set;
        }
    }).withFeatures(
            SetFeature.GENERAL_PURPOSE,
            CollectionSize.ANY,
            CollectionFeature.NON_STANDARD_TOSTRING)
      .named(SingleWriterHashSet.class.getSimpleName())
      .createTestSuite();
}