Search in sources :

Example 6 with Predicate

use of java.util.function.Predicate in project hibernate-orm by hibernate.

the class AbstractFunctionalTest method expectPutWithValue.

protected CountDownLatch expectPutWithValue(AdvancedCache cache, Predicate<Object> valuePredicate, int numUpdates) {
    if (!cacheMode.isInvalidation() && accessType != AccessType.NONSTRICT_READ_WRITE) {
        CountDownLatch latch = new CountDownLatch(numUpdates);
        ExpectingInterceptor.get(cache).when((ctx, cmd) -> cmd instanceof PutKeyValueCommand && valuePredicate.test(((PutKeyValueCommand) cmd).getValue())).countDown(latch);
        cleanup.add(() -> ExpectingInterceptor.cleanup(cache));
        return latch;
    } else {
        return new CountDownLatch(0);
    }
}
Also used : Property(org.hibernate.mapping.Property) AvailableSettings(org.hibernate.cfg.AvailableSettings) TxUtil(org.hibernate.test.cache.infinispan.util.TxUtil) RootClass(org.hibernate.mapping.RootClass) RunWith(org.junit.runner.RunWith) Session(org.hibernate.Session) JtaPlatformImpl(org.hibernate.test.cache.infinispan.tm.JtaPlatformImpl) Metadata(org.hibernate.boot.Metadata) ArrayList(java.util.ArrayList) XaConnectionProvider(org.hibernate.test.cache.infinispan.tm.XaConnectionProvider) AdvancedCache(org.infinispan.AdvancedCache) RegionFactory(org.hibernate.cache.spi.RegionFactory) PersistentClass(org.hibernate.mapping.PersistentClass) Map(java.util.Map) MetadataImplementor(org.hibernate.boot.spi.MetadataImplementor) After(org.junit.After) JtaTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl) ExpectingInterceptor(org.hibernate.test.cache.infinispan.util.ExpectingInterceptor) AccessType(org.hibernate.cache.spi.access.AccessType) Environment(org.hibernate.cfg.Environment) ClassRule(org.junit.ClassRule) Parameterized(org.junit.runners.Parameterized) SimpleCacheKeysFactory(org.hibernate.cache.internal.SimpleCacheKeysFactory) CustomParameterized(org.hibernate.testing.junit4.CustomParameterized) BaseNonConfigCoreFunctionalTestCase(org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase) Predicate(java.util.function.Predicate) SimpleValue(org.hibernate.mapping.SimpleValue) Column(org.hibernate.mapping.Column) TombstoneUpdate(org.hibernate.cache.infinispan.util.TombstoneUpdate) JtaPlatform(org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform) TestInfinispanRegionFactory(org.hibernate.test.cache.infinispan.util.TestInfinispanRegionFactory) TransactionCoordinatorBuilder(org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) CacheMode(org.infinispan.configuration.cache.CacheMode) FutureUpdate(org.hibernate.cache.infinispan.util.FutureUpdate) JdbcResourceLocalTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand) BeforeClassOnce(org.hibernate.testing.BeforeClassOnce) ConnectionProvider(org.hibernate.engine.jdbc.connections.spi.ConnectionProvider) InfinispanTestingSetup(org.hibernate.test.cache.infinispan.util.InfinispanTestingSetup) CountDownLatch(java.util.concurrent.CountDownLatch) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand)

Example 7 with Predicate

use of java.util.function.Predicate in project jersey by jersey.

the class ProviderBinder method bindProviders.

/**
     * Bind all providers contained in {@code p roviderBag} (classes and instances) using injection manager. Configuration is
     * also committed.
     *
     * @param componentBag      bag of provider classes and instances.
     * @param constrainedTo     current runtime (client or server).
     * @param registeredClasses classes which are manually registered by the user (not found by the classpath scanning).
     * @param injectionManager  injection manager the binder will use to bind the providers into.
     */
public static void bindProviders(ComponentBag componentBag, RuntimeType constrainedTo, Set<Class<?>> registeredClasses, InjectionManager injectionManager) {
    Predicate<ContractProvider> filter = ComponentBag.EXCLUDE_EMPTY.and(ComponentBag.excludeMetaProviders(injectionManager));
    /*
         * Check the {@code component} whether it is correctly configured for client or server {@link RuntimeType runtime}.
         */
    Predicate<Class<?>> correctlyConfigured = componentClass -> Providers.checkProviderRuntime(componentClass, componentBag.getModel(componentClass), constrainedTo, registeredClasses == null || !registeredClasses.contains(componentClass), false);
    /*
         * These binder will be register to Bean Manager at the and of method because of a bulk registration to avoid register
         * each binder alone.
         */
    Collection<Binder> binderToRegister = new ArrayList<>();
    // Bind provider classes except for pure meta-providers and providers with empty contract models (e.g. resources)
    Set<Class<?>> classes = new LinkedHashSet<>(componentBag.getClasses(filter));
    if (constrainedTo != null) {
        classes = classes.stream().filter(correctlyConfigured).collect(Collectors.toSet());
    }
    for (final Class<?> providerClass : classes) {
        final ContractProvider model = componentBag.getModel(providerClass);
        binderToRegister.addAll(createProviderBinders(providerClass, model));
    }
    // Bind pure provider instances except for pure meta-providers and providers with empty contract models (e.g. resources)
    Set<Object> instances = componentBag.getInstances(filter);
    if (constrainedTo != null) {
        instances = instances.stream().filter(component -> correctlyConfigured.test(component.getClass())).collect(Collectors.toSet());
    }
    for (final Object provider : instances) {
        final ContractProvider model = componentBag.getModel(provider.getClass());
        binderToRegister.addAll(createProviderBinders(provider, model));
    }
    injectionManager.register(CompositeBinder.wrap(binderToRegister));
}
Also used : Arrays(java.util.Arrays) RuntimeType(javax.ws.rs.RuntimeType) Predicate(java.util.function.Predicate) Collection(java.util.Collection) ComponentBag(org.glassfish.jersey.model.internal.ComponentBag) Set(java.util.Set) ContractProvider(org.glassfish.jersey.model.ContractProvider) Singleton(javax.inject.Singleton) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) List(java.util.List) Annotation(java.lang.annotation.Annotation) Collections(java.util.Collections) LinkedHashSet(java.util.LinkedHashSet) LinkedHashSet(java.util.LinkedHashSet) ContractProvider(org.glassfish.jersey.model.ContractProvider) ArrayList(java.util.ArrayList)

Example 8 with Predicate

use of java.util.function.Predicate in project neo4j by neo4j.

the class TestShortestPath method withFilters.

@Test
public void withFilters() throws Exception {
    // Layout:
    //
    // (a)-->(b)-->(c)-->(d)
    //   \               ^
    //    -->(g)-->(h)--/
    //
    graph.makeEdgeChain("a,b,c,d");
    graph.makeEdgeChain("a,g,h,d");
    final Node a = graph.getNode("a");
    final Node d = graph.getNode("d");
    final Node b = graph.getNode("b");
    b.setProperty("skip", true);
    final Predicate<Node> filter = item -> {
        final boolean skip = (Boolean) item.getProperty("skip", false);
        return !skip;
    };
    testShortestPathFinder(finder -> assertPaths(finder.findAllPaths(a, d), "a,g,h,d"), ((StandardExpander) PathExpanders.allTypesAndDirections()).addNodeFilter(filter), 10);
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) Arrays(java.util.Arrays) ResourceIterator(org.neo4j.graphdb.ResourceIterator) MutableInt(org.apache.commons.lang3.mutable.MutableInt) Label(org.neo4j.graphdb.Label) Direction(org.neo4j.graphdb.Direction) PathFinder(org.neo4j.graphalgo.PathFinder) OUTGOING(org.neo4j.graphdb.Direction.OUTGOING) GraphAlgoFactory.shortestPath(org.neo4j.graphalgo.GraphAlgoFactory.shortestPath) PathExpanders(org.neo4j.graphdb.PathExpanders) Node(org.neo4j.graphdb.Node) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Assert.assertThat(org.junit.Assert.assertThat) BOTH(org.neo4j.graphdb.Direction.BOTH) PathExpander(org.neo4j.graphdb.PathExpander) Arrays.asList(java.util.Arrays.asList) R1(common.Neo4jAlgoTestCase.MyRelTypes.R1) StandardExpander(org.neo4j.graphdb.impl.StandardExpander) Iterator(java.util.Iterator) Predicate(java.util.function.Predicate) Set(java.util.Set) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Neo4jAlgoTestCase(common.Neo4jAlgoTestCase) INCOMING(org.neo4j.graphdb.Direction.INCOMING) BranchState(org.neo4j.graphdb.traversal.BranchState) Path(org.neo4j.graphdb.Path) List(java.util.List) Relationship(org.neo4j.graphdb.Relationship) Iterables(org.neo4j.helpers.collection.Iterables) Assert.assertFalse(org.junit.Assert.assertFalse) PathExpanders.allTypesAndDirections(org.neo4j.graphdb.PathExpanders.allTypesAndDirections) RelationshipType(org.neo4j.graphdb.RelationshipType) Assert.assertEquals(org.junit.Assert.assertEquals) Node(org.neo4j.graphdb.Node) Test(org.junit.Test)

Example 9 with Predicate

use of java.util.function.Predicate in project neo4j by neo4j.

the class StoreMigrator method moveMigratedFiles.

@Override
public void moveMigratedFiles(File migrationDir, File storeDir, String versionToUpgradeFrom, String versionToUpgradeTo) throws IOException {
    // Move the migrated ones into the store directory
    StoreFile.fileOperation(MOVE, fileSystem, migrationDir, storeDir, StoreFile.currentStoreFiles(), // allow to skip non existent source files
    true, // allow to overwrite target files
    ExistingTargetStrategy.OVERWRITE, StoreFileType.values());
    // move the files with the page cache.
    try {
        Iterable<FileHandle> fileHandles = pageCache.streamFilesRecursive(migrationDir)::iterator;
        for (FileHandle fh : fileHandles) {
            Predicate<StoreFile> predicate = storeFile -> storeFile.fileName(StoreFileType.STORE).equals(fh.getFile().getName());
            if (StreamSupport.stream(StoreFile.currentStoreFiles().spliterator(), false).anyMatch(predicate)) {
                final Optional<PagedFile> optionalPagedFile = pageCache.getExistingMapping(fh.getFile());
                if (optionalPagedFile.isPresent()) {
                    optionalPagedFile.get().close();
                }
                fh.rename(new File(storeDir, fh.getFile().getName()), StandardCopyOption.REPLACE_EXISTING);
            }
        }
    } catch (NoSuchFileException e) {
    //This means that we had no files only present in the page cache, this is fine.
    }
    RecordFormats oldFormat = selectForVersion(versionToUpgradeFrom);
    RecordFormats newFormat = selectForVersion(versionToUpgradeTo);
    boolean movingAwayFromVersionTrailers = oldFormat.hasCapability(VERSION_TRAILERS) && !newFormat.hasCapability(VERSION_TRAILERS);
    if (movingAwayFromVersionTrailers) {
        StoreFile.removeTrailers(versionToUpgradeFrom, fileSystem, storeDir, pageCache.pageSize());
    }
    File neoStore = new File(storeDir, MetaDataStore.DEFAULT_NAME);
    long logVersion = MetaDataStore.getRecord(pageCache, neoStore, Position.LOG_VERSION);
    long lastCommittedTx = MetaDataStore.getRecord(pageCache, neoStore, Position.LAST_TRANSACTION_ID);
    // update or add upgrade id and time and other necessary neostore records
    updateOrAddNeoStoreFieldsAsPartOfMigration(migrationDir, storeDir, versionToUpgradeTo);
    // delete old logs
    legacyLogs.deleteUnusedLogFiles(storeDir);
    if (movingAwayFromVersionTrailers) {
        // write a check point in the log in order to make recovery work in the newer version
        new StoreMigratorCheckPointer(storeDir, fileSystem).checkPoint(logVersion, lastCommittedTx);
    }
}
Also used : PropertyDeduplicator(org.neo4j.kernel.impl.storemigration.legacystore.v21.propertydeduplication.PropertyDeduplicator) Arrays(java.util.Arrays) PageCursor(org.neo4j.io.pagecache.PageCursor) NullLogProvider(org.neo4j.logging.NullLogProvider) StringUtils(org.apache.commons.lang3.StringUtils) UNKNOWN_TX_COMMIT_TIMESTAMP(org.neo4j.kernel.impl.transaction.log.TransactionIdStore.UNKNOWN_TX_COMMIT_TIMESTAMP) COPY(org.neo4j.kernel.impl.storemigration.FileOperation.COPY) SchemaIndexProvider(org.neo4j.kernel.api.index.SchemaIndexProvider) CountsComputer(org.neo4j.kernel.impl.store.CountsComputer) Arrays.asList(java.util.Arrays.asList) BASE_TX_COMMIT_TIMESTAMP(org.neo4j.kernel.impl.transaction.log.TransactionIdStore.BASE_TX_COMMIT_TIMESTAMP) Position(org.neo4j.kernel.impl.store.MetaDataStore.Position) Lifespan(org.neo4j.kernel.lifecycle.Lifespan) RecordCursors(org.neo4j.kernel.impl.store.RecordCursors) SilentMigrationProgressMonitor(org.neo4j.kernel.impl.storemigration.monitoring.SilentMigrationProgressMonitor) StandardCharsets(java.nio.charset.StandardCharsets) MetaDataRecordFormat(org.neo4j.kernel.impl.store.format.standard.MetaDataRecordFormat) DELETE(org.neo4j.kernel.impl.storemigration.FileOperation.DELETE) Stream(java.util.stream.Stream) ExecutionSupervisors.withDynamicProcessorAssignment(org.neo4j.unsafe.impl.batchimport.staging.ExecutionSupervisors.withDynamicProcessorAssignment) StoreType(org.neo4j.kernel.impl.store.StoreType) BatchImporter(org.neo4j.unsafe.impl.batchimport.BatchImporter) NodeStore(org.neo4j.kernel.impl.store.NodeStore) StoreFactory(org.neo4j.kernel.impl.store.StoreFactory) Collectors(org.neo4j.unsafe.impl.batchimport.input.Collectors) PagedFile(org.neo4j.io.pagecache.PagedFile) VERSION_TRAILERS(org.neo4j.kernel.impl.store.format.Capability.VERSION_TRAILERS) FormatFamily(org.neo4j.kernel.impl.store.format.FormatFamily) Supplier(java.util.function.Supplier) UNKNOWN_TX_CHECKSUM(org.neo4j.kernel.impl.transaction.log.TransactionIdStore.UNKNOWN_TX_CHECKSUM) BufferedOutputStream(java.io.BufferedOutputStream) StandardCopyOption(java.nio.file.StandardCopyOption) ArrayList(java.util.ArrayList) TransactionId(org.neo4j.kernel.impl.store.TransactionId) StandardV2_2(org.neo4j.kernel.impl.store.format.standard.StandardV2_2) LogPosition(org.neo4j.kernel.impl.transaction.log.LogPosition) StandardV2_1(org.neo4j.kernel.impl.store.format.standard.StandardV2_1) RelationshipStore(org.neo4j.kernel.impl.store.RelationshipStore) StandardV2_0(org.neo4j.kernel.impl.store.format.standard.StandardV2_0) IdMappers(org.neo4j.unsafe.impl.batchimport.cache.idmapping.IdMappers) BiConsumer(java.util.function.BiConsumer) IdGenerators(org.neo4j.unsafe.impl.batchimport.cache.idmapping.IdGenerators) StreamSupport(java.util.stream.StreamSupport) DirectRecordStoreMigrator(org.neo4j.kernel.impl.storemigration.DirectRecordStoreMigrator) CoarseBoundedProgressExecutionMonitor(org.neo4j.unsafe.impl.batchimport.staging.CoarseBoundedProgressExecutionMonitor) StoreFile(org.neo4j.kernel.impl.storemigration.StoreFile) FileOutputStream(java.io.FileOutputStream) RecordFormatSelector.selectForVersion(org.neo4j.kernel.impl.store.format.RecordFormatSelector.selectForVersion) IOException(java.io.IOException) NodeRecordFormat(org.neo4j.kernel.impl.store.format.standard.NodeRecordFormat) LegacyLogs(org.neo4j.kernel.impl.storemigration.legacylogs.LegacyLogs) File(java.io.File) Iterables(org.neo4j.helpers.collection.Iterables) ParallelBatchImporter(org.neo4j.unsafe.impl.batchimport.ParallelBatchImporter) NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) Configuration(org.neo4j.unsafe.impl.batchimport.Configuration) BufferedReader(java.io.BufferedReader) MigrationProgressMonitor(org.neo4j.kernel.impl.storemigration.monitoring.MigrationProgressMonitor) RelationshipRecord(org.neo4j.kernel.impl.store.record.RelationshipRecord) StoreUpgrader(org.neo4j.kernel.impl.storemigration.StoreUpgrader) NoSuchFileException(java.nio.file.NoSuchFileException) BASE_TX_LOG_VERSION(org.neo4j.kernel.impl.transaction.log.TransactionIdStore.BASE_TX_LOG_VERSION) BASE_TX_CHECKSUM(org.neo4j.kernel.impl.transaction.log.TransactionIdStore.BASE_TX_CHECKSUM) PageCache(org.neo4j.io.pagecache.PageCache) InputNode(org.neo4j.unsafe.impl.batchimport.input.InputNode) Predicate(java.util.function.Predicate) Collection(java.util.Collection) StandardOpenOption(java.nio.file.StandardOpenOption) MOVE(org.neo4j.kernel.impl.storemigration.FileOperation.MOVE) LogService(org.neo4j.kernel.impl.logging.LogService) List(java.util.List) StoreFileType(org.neo4j.kernel.impl.storemigration.StoreFileType) MetaDataStore(org.neo4j.kernel.impl.store.MetaDataStore) Writer(java.io.Writer) Optional(java.util.Optional) Inputs(org.neo4j.unsafe.impl.batchimport.input.Inputs) InputIterable(org.neo4j.unsafe.impl.batchimport.InputIterable) InputRelationship(org.neo4j.unsafe.impl.batchimport.input.InputRelationship) TransactionIdStore(org.neo4j.kernel.impl.transaction.log.TransactionIdStore) InputEntity(org.neo4j.unsafe.impl.batchimport.input.InputEntity) DEFAULT_NAME(org.neo4j.kernel.impl.store.MetaDataStore.DEFAULT_NAME) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) CustomIOConfigValidator(org.neo4j.kernel.impl.util.CustomIOConfigValidator) AdditionalInitialIds(org.neo4j.unsafe.impl.batchimport.AdditionalInitialIds) NeoStores(org.neo4j.kernel.impl.store.NeoStores) StorePropertyCursor(org.neo4j.kernel.impl.api.store.StorePropertyCursor) CountsTracker(org.neo4j.kernel.impl.store.counts.CountsTracker) ExistingTargetStrategy(org.neo4j.kernel.impl.storemigration.ExistingTargetStrategy) PhysicalLogFiles(org.neo4j.kernel.impl.transaction.log.PhysicalLogFiles) RelationshipRecordFormat(org.neo4j.kernel.impl.store.format.standard.RelationshipRecordFormat) OutputStream(java.io.OutputStream) Config(org.neo4j.kernel.configuration.Config) ReadOnlyIdGeneratorFactory(org.neo4j.kernel.impl.store.id.ReadOnlyIdGeneratorFactory) LockService(org.neo4j.kernel.impl.locking.LockService) FileHandle(org.neo4j.io.pagecache.FileHandle) CapabilityType(org.neo4j.kernel.impl.store.format.CapabilityType) PrimitiveRecord(org.neo4j.kernel.impl.store.record.PrimitiveRecord) FIELD_NOT_PRESENT(org.neo4j.kernel.impl.store.format.standard.MetaDataRecordFormat.FIELD_NOT_PRESENT) StoreMigratorCheckPointer(org.neo4j.kernel.impl.storemigration.StoreMigratorCheckPointer) ExecutionMonitor(org.neo4j.unsafe.impl.batchimport.staging.ExecutionMonitor) BASE_TX_LOG_BYTE_OFFSET(org.neo4j.kernel.impl.transaction.log.TransactionIdStore.BASE_TX_LOG_BYTE_OFFSET) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) PagedFile(org.neo4j.io.pagecache.PagedFile) FileHandle(org.neo4j.io.pagecache.FileHandle) NoSuchFileException(java.nio.file.NoSuchFileException) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) StoreFile(org.neo4j.kernel.impl.storemigration.StoreFile) PagedFile(org.neo4j.io.pagecache.PagedFile) StoreFile(org.neo4j.kernel.impl.storemigration.StoreFile) File(java.io.File) StoreMigratorCheckPointer(org.neo4j.kernel.impl.storemigration.StoreMigratorCheckPointer)

Example 10 with Predicate

use of java.util.function.Predicate in project neo4j by neo4j.

the class DelayedBufferTest method shouldHandleTheWholeWorkloadShebang.

@Test
public void shouldHandleTheWholeWorkloadShebang() throws Throwable {
    // GIVEN
    final int size = 1_000;
    final long bufferTime = 3;
    VerifyingConsumer consumer = new VerifyingConsumer(size);
    final Clock clock = Clocks.systemClock();
    Supplier<Long> chunkThreshold = clock::millis;
    Predicate<Long> safeThreshold = time -> clock.millis() - bufferTime >= time;
    final DelayedBuffer<Long> buffer = new DelayedBuffer<>(chunkThreshold, safeThreshold, 10, consumer);
    MaintenanceThread maintenance = new MaintenanceThread(buffer, 5);
    Race adders = new Race();
    final int numberOfAdders = 20;
    final byte[] offeredIds = new byte[size];
    for (int i = 0; i < numberOfAdders; i++) {
        final int finalI = i;
        adders.addContestant(new Runnable() {

            @Override
            public void run() {
                for (int j = 0; j < size; j++) {
                    if (j % numberOfAdders == finalI) {
                        buffer.offer(j);
                        offeredIds[j] = 1;
                        parkNanos(MILLISECONDS.toNanos(current().nextInt(2)));
                    }
                }
            }
        });
    }
    // WHEN (multi-threadded) offering of ids
    adders.go();
    // ... ensuring the test is sane itself (did we really offer all these IDs?)
    for (int i = 0; i < size; i++) {
        assertEquals("ID " + i, (byte) 1, offeredIds[i]);
    }
    maintenance.halt();
    buffer.close();
    // THEN
    consumer.assertHaveOnlySeenRange(0, size - 1);
}
Also used : Suppliers.singleton(org.neo4j.function.Suppliers.singleton) ThreadLocalRandom.current(java.util.concurrent.ThreadLocalRandom.current) Predicate(java.util.function.Predicate) Predicates(org.neo4j.function.Predicates) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Test(org.junit.Test) LockSupport.parkNanos(java.util.concurrent.locks.LockSupport.parkNanos) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Supplier(java.util.function.Supplier) LockSupport(java.util.concurrent.locks.LockSupport) Consumer(java.util.function.Consumer) AtomicLong(java.util.concurrent.atomic.AtomicLong) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Utils.safeCastLongToInt(org.neo4j.unsafe.impl.batchimport.Utils.safeCastLongToInt) Assert.assertFalse(org.junit.Assert.assertFalse) Clock(java.time.Clock) Assert.fail(org.junit.Assert.fail) Clocks(org.neo4j.time.Clocks) Race(org.neo4j.test.Race) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Clock(java.time.Clock) Race(org.neo4j.test.Race) AtomicLong(java.util.concurrent.atomic.AtomicLong) Test(org.junit.Test)

Aggregations

Predicate (java.util.function.Predicate)76 List (java.util.List)34 Map (java.util.Map)21 Arrays (java.util.Arrays)19 IOException (java.io.IOException)18 Collections (java.util.Collections)16 Collectors (java.util.stream.Collectors)16 Test (org.junit.Test)14 ArrayList (java.util.ArrayList)13 Assert.assertEquals (org.junit.Assert.assertEquals)10 Mockito.mock (org.mockito.Mockito.mock)9 InputStream (java.io.InputStream)7 HashMap (java.util.HashMap)7 Optional (java.util.Optional)7 ImmutableList (com.google.common.collect.ImmutableList)6 ImmutableSet (com.google.common.collect.ImmutableSet)6 BufferedReader (java.io.BufferedReader)6 Set (java.util.Set)6 SortedSet (java.util.SortedSet)6 Before (org.junit.Before)6