Search in sources :

Example 1 with Predicate

use of java.util.function.Predicate in project elasticsearch by elastic.

the class TransportClusterHealthAction method executeHealth.

private void executeHealth(final ClusterHealthRequest request, final ActionListener<ClusterHealthResponse> listener) {
    int waitFor = 5;
    if (request.waitForStatus() == null) {
        waitFor--;
    }
    if (request.waitForNoRelocatingShards() == false) {
        waitFor--;
    }
    if (request.waitForActiveShards().equals(ActiveShardCount.NONE)) {
        waitFor--;
    }
    if (request.waitForNodes().isEmpty()) {
        waitFor--;
    }
    if (request.indices() == null || request.indices().length == 0) {
        // check that they actually exists in the meta data
        waitFor--;
    }
    assert waitFor >= 0;
    final ClusterState state = clusterService.state();
    final ClusterStateObserver observer = new ClusterStateObserver(state, clusterService, null, logger, threadPool.getThreadContext());
    if (request.timeout().millis() == 0) {
        listener.onResponse(getResponse(request, state, waitFor, request.timeout().millis() == 0));
        return;
    }
    final int concreteWaitFor = waitFor;
    final Predicate<ClusterState> validationPredicate = newState -> validateRequest(request, newState, concreteWaitFor);
    final ClusterStateObserver.Listener stateListener = new ClusterStateObserver.Listener() {

        @Override
        public void onNewClusterState(ClusterState clusterState) {
            listener.onResponse(getResponse(request, clusterState, concreteWaitFor, false));
        }

        @Override
        public void onClusterServiceClose() {
            listener.onFailure(new IllegalStateException("ClusterService was close during health call"));
        }

        @Override
        public void onTimeout(TimeValue timeout) {
            final ClusterHealthResponse response = getResponse(request, observer.setAndGetObservedState(), concreteWaitFor, true);
            listener.onResponse(response);
        }
    };
    if (validationPredicate.test(state)) {
        stateListener.onNewClusterState(state);
    } else {
        observer.waitForNextChange(stateListener, validationPredicate, request.timeout());
    }
}
Also used : ClusterService(org.elasticsearch.cluster.service.ClusterService) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) Strings(org.elasticsearch.common.Strings) Inject(org.elasticsearch.common.inject.Inject) ClusterState(org.elasticsearch.cluster.ClusterState) ClusterStateUpdateTask(org.elasticsearch.cluster.ClusterStateUpdateTask) Settings(org.elasticsearch.common.settings.Settings) ClusterBlockException(org.elasticsearch.cluster.block.ClusterBlockException) IndexNotFoundException(org.elasticsearch.index.IndexNotFoundException) TransportMasterNodeReadAction(org.elasticsearch.action.support.master.TransportMasterNodeReadAction) TimeValue(org.elasticsearch.common.unit.TimeValue) IndicesOptions(org.elasticsearch.action.support.IndicesOptions) ThreadPool(org.elasticsearch.threadpool.ThreadPool) TransportService(org.elasticsearch.transport.TransportService) ClusterStateObserver(org.elasticsearch.cluster.ClusterStateObserver) ActionFilters(org.elasticsearch.action.support.ActionFilters) Predicate(java.util.function.Predicate) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) ActiveShardCount(org.elasticsearch.action.support.ActiveShardCount) Supplier(org.apache.logging.log4j.util.Supplier) LocalClusterUpdateTask(org.elasticsearch.cluster.LocalClusterUpdateTask) ClusterHealthStatus(org.elasticsearch.cluster.health.ClusterHealthStatus) IndexNameExpressionResolver(org.elasticsearch.cluster.metadata.IndexNameExpressionResolver) Task(org.elasticsearch.tasks.Task) ActionListener(org.elasticsearch.action.ActionListener) GatewayAllocator(org.elasticsearch.gateway.GatewayAllocator) ClusterState(org.elasticsearch.cluster.ClusterState) ClusterStateObserver(org.elasticsearch.cluster.ClusterStateObserver) ActionListener(org.elasticsearch.action.ActionListener) TimeValue(org.elasticsearch.common.unit.TimeValue)

Example 2 with Predicate

use of java.util.function.Predicate in project elasticsearch by elastic.

the class ActiveShardsObserver method waitForActiveShards.

/**
     * Waits on the specified number of active shards to be started before executing the
     *
     * @param indexName the index to wait for active shards on
     * @param activeShardCount the number of active shards to wait on before returning
     * @param timeout the timeout value
     * @param onResult a function that is executed in response to the requisite shards becoming active or a timeout (whichever comes first)
     * @param onFailure a function that is executed in response to an error occurring during waiting for the active shards
     */
public void waitForActiveShards(final String indexName, final ActiveShardCount activeShardCount, final TimeValue timeout, final Consumer<Boolean> onResult, final Consumer<Exception> onFailure) {
    // wait for the configured number of active shards to be allocated before executing the result consumer
    if (activeShardCount == ActiveShardCount.NONE) {
        // not waiting, so just run whatever we were to run when the waiting is
        onResult.accept(true);
        return;
    }
    final ClusterState state = clusterService.state();
    final ClusterStateObserver observer = new ClusterStateObserver(state, clusterService, null, logger, threadPool.getThreadContext());
    if (activeShardCount.enoughShardsActive(state, indexName)) {
        onResult.accept(true);
    } else {
        final Predicate<ClusterState> shardsAllocatedPredicate = newState -> activeShardCount.enoughShardsActive(newState, indexName);
        final ClusterStateObserver.Listener observerListener = new ClusterStateObserver.Listener() {

            @Override
            public void onNewClusterState(ClusterState state) {
                onResult.accept(true);
            }

            @Override
            public void onClusterServiceClose() {
                logger.debug("[{}] cluster service closed while waiting for enough shards to be started.", indexName);
                onFailure.accept(new NodeClosedException(clusterService.localNode()));
            }

            @Override
            public void onTimeout(TimeValue timeout) {
                onResult.accept(false);
            }
        };
        observer.waitForNextChange(observerListener, shardsAllocatedPredicate, timeout);
    }
}
Also used : Consumer(java.util.function.Consumer) ClusterState(org.elasticsearch.cluster.ClusterState) Settings(org.elasticsearch.common.settings.Settings) AbstractComponent(org.elasticsearch.common.component.AbstractComponent) Predicate(java.util.function.Predicate) TimeValue(org.elasticsearch.common.unit.TimeValue) ClusterService(org.elasticsearch.cluster.service.ClusterService) ThreadPool(org.elasticsearch.threadpool.ThreadPool) ClusterStateObserver(org.elasticsearch.cluster.ClusterStateObserver) NodeClosedException(org.elasticsearch.node.NodeClosedException) ActionListener(org.elasticsearch.action.ActionListener) ClusterState(org.elasticsearch.cluster.ClusterState) ClusterStateObserver(org.elasticsearch.cluster.ClusterStateObserver) ActionListener(org.elasticsearch.action.ActionListener) NodeClosedException(org.elasticsearch.node.NodeClosedException) TimeValue(org.elasticsearch.common.unit.TimeValue)

Example 3 with Predicate

use of java.util.function.Predicate in project buck by facebook.

the class JavaDepsFinder method findDepsForBuildFiles.

private DepsForBuildFiles findDepsForBuildFiles(final TargetGraph graph, final DependencyInfo dependencyInfo, final Console console) {
    // For the rules that expect to have their deps generated, look through all of their required
    // symbols and try to find the build rule that provides each symbols. Store these build rules in
    // the depsForBuildFiles data structure.
    //
    // Currently, we process each rule with autodeps=True on a single thread. See the class overview
    // for DepsForBuildFiles about what it would take to do this work in a multi-threaded way.
    DepsForBuildFiles depsForBuildFiles = new DepsForBuildFiles();
    for (final TargetNode<?, ?> rule : dependencyInfo.rulesWithAutodeps) {
        final Set<BuildTarget> providedDeps = dependencyInfo.rulesWithAutodepsToProvidedDeps.get(rule);
        final Predicate<TargetNode<?, ?>> isVisibleDepNotAlreadyInProvidedDeps = provider -> provider.isVisibleTo(graph, rule) && !providedDeps.contains(provider.getBuildTarget());
        final boolean isJavaTestRule = rule.getDescription() instanceof JavaTestDescription;
        for (DependencyType type : DependencyType.values()) {
            HashMultimap<TargetNode<?, ?>, String> ruleToSymbolsMap;
            switch(type) {
                case DEPS:
                    ruleToSymbolsMap = dependencyInfo.ruleToRequiredSymbols;
                    break;
                case EXPORTED_DEPS:
                    ruleToSymbolsMap = dependencyInfo.ruleToExportedSymbols;
                    break;
                default:
                    throw new IllegalStateException("Unrecognized type: " + type);
            }
            final DependencyType typeOfDepToAdd;
            if (isJavaTestRule) {
                // java_test rules do not honor exported_deps: add all dependencies to the ordinary deps.
                typeOfDepToAdd = DependencyType.DEPS;
            } else {
                typeOfDepToAdd = type;
            }
            for (String requiredSymbol : ruleToSymbolsMap.get(rule)) {
                BuildTarget provider = findProviderForSymbolFromBuckConfig(requiredSymbol);
                if (provider != null) {
                    depsForBuildFiles.addDep(rule.getBuildTarget(), provider, typeOfDepToAdd);
                    continue;
                }
                Set<TargetNode<?, ?>> providers = dependencyInfo.symbolToProviders.get(requiredSymbol);
                SortedSet<TargetNode<?, ?>> candidateProviders = providers.stream().filter(isVisibleDepNotAlreadyInProvidedDeps).collect(MoreCollectors.toImmutableSortedSet(Comparator.<TargetNode<?, ?>>naturalOrder()));
                int numCandidates = candidateProviders.size();
                if (numCandidates == 1) {
                    depsForBuildFiles.addDep(rule.getBuildTarget(), Iterables.getOnlyElement(candidateProviders).getBuildTarget(), typeOfDepToAdd);
                } else if (numCandidates > 1) {
                    // Warn the user that there is an ambiguity. This could be very common with macros that
                    // generate multiple versions of a java_library() with the same sources.
                    // If numProviders is 0, then hopefully the dep is provided by something the user
                    // hardcoded in the BUCK file.
                    console.printErrorText(String.format("WARNING: Multiple providers for %s: %s. " + "Consider adding entry to .buckconfig to eliminate ambiguity:\n" + "[autodeps]\n" + "java-package-mappings = %s => %s", requiredSymbol, Joiner.on(", ").join(candidateProviders), requiredSymbol, Iterables.getFirst(candidateProviders, null)));
                } else {
                    // If there aren't any candidates, then see if there is a visible rule that can provide
                    // the symbol via its exported_deps. We make this a secondary check because we prefer to
                    // depend on the rule that defines the symbol directly rather than one of possibly many
                    // rules that provides it via its exported_deps.
                    ImmutableSortedSet<TargetNode<?, ?>> newCandidates = providers.stream().flatMap(candidate -> dependencyInfo.ruleToRulesThatExportIt.get(candidate).stream()).filter(ruleThatExportsCandidate -> ruleThatExportsCandidate.isVisibleTo(graph, rule)).collect(MoreCollectors.toImmutableSortedSet(Comparator.<TargetNode<?, ?>>naturalOrder()));
                    int numNewCandidates = newCandidates.size();
                    if (numNewCandidates == 1) {
                        depsForBuildFiles.addDep(rule.getBuildTarget(), Iterables.getOnlyElement(newCandidates).getBuildTarget(), typeOfDepToAdd);
                    } else if (numNewCandidates > 1) {
                        console.printErrorText(String.format("WARNING: No providers found for '%s' for build rule %s, " + "but there are multiple rules that export a rule to provide %s: %s", requiredSymbol, rule.getBuildTarget(), requiredSymbol, Joiner.on(", ").join(newCandidates)));
                    }
                // In the case that numNewCandidates is 0, we assume that the user is taking
                // responsibility for declaring a provider for the symbol by hardcoding it in the deps.
                }
            }
        }
    }
    return depsForBuildFiles;
}
Also used : Iterables(com.google.common.collect.Iterables) BuildRuleType(com.facebook.buck.rules.BuildRuleType) CellPathResolver(com.facebook.buck.rules.CellPathResolver) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) SortedSet(java.util.SortedSet) JavaBuckConfig(com.facebook.buck.jvm.java.JavaBuckConfig) ExecutionContext(com.facebook.buck.step.ExecutionContext) HashSet(java.util.HashSet) AndroidLibraryDescription(com.facebook.buck.android.AndroidLibraryDescription) BuckConfig(com.facebook.buck.cli.BuckConfig) HashMultimap(com.google.common.collect.HashMultimap) PrebuiltJarDescription(com.facebook.buck.jvm.java.PrebuiltJarDescription) JavaFileParser(com.facebook.buck.jvm.java.JavaFileParser) BuildTargetPatternParser(com.facebook.buck.parser.BuildTargetPatternParser) BuildTargetParser(com.facebook.buck.parser.BuildTargetParser) Map(java.util.Map) JavaLibraryDescription(com.facebook.buck.jvm.java.JavaLibraryDescription) Splitter(com.google.common.base.Splitter) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) Nullable(javax.annotation.Nullable) MoreCollectors(com.facebook.buck.util.MoreCollectors) ImmutableSortedSet(com.google.common.collect.ImmutableSortedSet) ImmutableSet(com.google.common.collect.ImmutableSet) DepsForBuildFiles(com.facebook.buck.autodeps.DepsForBuildFiles) Predicate(java.util.function.Predicate) TargetGraph(com.facebook.buck.rules.TargetGraph) TargetNode(com.facebook.buck.rules.TargetNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) CharMatcher(com.google.common.base.CharMatcher) Set(java.util.Set) JavacOptions(com.facebook.buck.jvm.java.JavacOptions) Console(com.facebook.buck.util.Console) BuildTarget(com.facebook.buck.model.BuildTarget) Maps(com.google.common.collect.Maps) JavaTestDescription(com.facebook.buck.jvm.java.JavaTestDescription) BuildResult(com.facebook.buck.rules.BuildResult) Futures(com.google.common.util.concurrent.Futures) BuildEngineBuildContext(com.facebook.buck.rules.BuildEngineBuildContext) Stream(java.util.stream.Stream) DependencyType(com.facebook.buck.autodeps.DepsForBuildFiles.DependencyType) BuildEngine(com.facebook.buck.rules.BuildEngine) Optional(java.util.Optional) Preconditions(com.google.common.base.Preconditions) Comparator(java.util.Comparator) Description(com.facebook.buck.rules.Description) Joiner(com.google.common.base.Joiner) TargetNode(com.facebook.buck.rules.TargetNode) DepsForBuildFiles(com.facebook.buck.autodeps.DepsForBuildFiles) BuildTarget(com.facebook.buck.model.BuildTarget) ImmutableSortedSet(com.google.common.collect.ImmutableSortedSet) DependencyType(com.facebook.buck.autodeps.DepsForBuildFiles.DependencyType) JavaTestDescription(com.facebook.buck.jvm.java.JavaTestDescription)

Example 4 with Predicate

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

the class AbstractRegionAccessStrategyTest method expectPutWithValue.

protected CountDownLatch expectPutWithValue(Predicate<Object> valuePredicate) {
    if (!isUsingInvalidation() && accessType != AccessType.NONSTRICT_READ_WRITE) {
        CountDownLatch latch = new CountDownLatch(1);
        ExpectingInterceptor.get(remoteRegion.getCache()).when((ctx, cmd) -> cmd instanceof PutKeyValueCommand && valuePredicate.test(((PutKeyValueCommand) cmd).getValue())).countDown(latch);
        cleanup.add(() -> ExpectingInterceptor.cleanup(remoteRegion.getCache()));
        return latch;
    } else {
        return new CountDownLatch(0);
    }
}
Also used : Arrays(java.util.Arrays) Connection(java.sql.Connection) BatchModeJtaPlatform(org.hibernate.test.cache.infinispan.util.BatchModeJtaPlatform) Cache(org.infinispan.Cache) Transaction(org.hibernate.Transaction) AdvancedCache(org.infinispan.AdvancedCache) After(org.junit.After) Mockito.doAnswer(org.mockito.Mockito.doAnswer) CacheDataDescriptionImpl(org.hibernate.cache.internal.CacheDataDescriptionImpl) TestingUtil(org.infinispan.test.TestingUtil) AccessType(org.hibernate.cache.spi.access.AccessType) Predicate(java.util.function.Predicate) TombstoneUpdate(org.hibernate.cache.infinispan.util.TombstoneUpdate) JdbcResourceTransactionAccess(org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess) TestSynchronization(org.hibernate.test.cache.infinispan.util.TestSynchronization) Matchers.any(org.mockito.Matchers.any) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) SoftLock(org.hibernate.cache.spi.access.SoftLock) JdbcSessionOwner(org.hibernate.resource.jdbc.spi.JdbcSessionOwner) AfterClassOnce(org.hibernate.testing.AfterClassOnce) FutureUpdate(org.hibernate.cache.infinispan.util.FutureUpdate) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand) TransactionImpl(org.hibernate.engine.transaction.internal.TransactionImpl) PutFromLoadValidator(org.hibernate.cache.infinispan.access.PutFromLoadValidator) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) Mockito.mock(org.mockito.Mockito.mock) JdbcConnectionAccess(org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess) TestResourceTracker(org.infinispan.test.fwk.TestResourceTracker) Logger(org.jboss.logging.Logger) TransactionCoordinator(org.hibernate.resource.transaction.spi.TransactionCoordinator) Session(org.hibernate.Session) Caches(org.hibernate.cache.infinispan.util.Caches) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) RegionAccessStrategy(org.hibernate.cache.spi.access.RegionAccessStrategy) SQLException(java.sql.SQLException) TestTimeService(org.hibernate.test.cache.infinispan.util.TestTimeService) RollbackException(javax.transaction.RollbackException) TransactionCoordinatorOwner(org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner) ExpectingInterceptor(org.hibernate.test.cache.infinispan.util.ExpectingInterceptor) ComparableComparator(org.hibernate.internal.util.compare.ComparableComparator) BatchModeTransactionCoordinator(org.hibernate.test.cache.infinispan.util.BatchModeTransactionCoordinator) JdbcResourceTransactionMock(org.hibernate.test.cache.infinispan.util.JdbcResourceTransactionMock) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) AssertionFailedError(junit.framework.AssertionFailedError) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) JdbcSessionContext(org.hibernate.resource.jdbc.spi.JdbcSessionContext) TestInfinispanRegionFactory(org.hibernate.test.cache.infinispan.util.TestInfinispanRegionFactory) Mockito.when(org.mockito.Mockito.when) BaseRegion(org.hibernate.cache.infinispan.impl.BaseRegion) ServiceRegistry(org.hibernate.service.ServiceRegistry) TimeUnit(java.util.concurrent.TimeUnit) CacheDataDescription(org.hibernate.cache.spi.CacheDataDescription) InvalidateCommand(org.infinispan.commands.write.InvalidateCommand) Assert.assertNull(org.junit.Assert.assertNull) SystemException(javax.transaction.SystemException) JdbcResourceLocalTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl) SqlExceptionHelper(org.hibernate.engine.jdbc.spi.SqlExceptionHelper) BeforeClassOnce(org.hibernate.testing.BeforeClassOnce) Assert.assertEquals(org.junit.Assert.assertEquals) CountDownLatch(java.util.concurrent.CountDownLatch) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand)

Example 5 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)

Aggregations

Predicate (java.util.function.Predicate)589 List (java.util.List)266 ArrayList (java.util.ArrayList)170 Collectors (java.util.stream.Collectors)167 Map (java.util.Map)164 Set (java.util.Set)137 Test (org.junit.Test)133 IOException (java.io.IOException)122 Collections (java.util.Collections)118 Arrays (java.util.Arrays)110 HashMap (java.util.HashMap)105 Collection (java.util.Collection)93 Optional (java.util.Optional)87 HashSet (java.util.HashSet)85 Stream (java.util.stream.Stream)69 Function (java.util.function.Function)61 File (java.io.File)60 Iterator (java.util.Iterator)55 Logger (org.slf4j.Logger)53 LoggerFactory (org.slf4j.LoggerFactory)52