Replace Stream.concat with Streams.concat

Stream.concat only accepts 2 parameters. Streams.concat on the other hand
accepts any number of parameters.

Moving to Streams.concat for all uses (2 or more) makes sense for uniformity
and convenience reasons.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179716648
This commit is contained in:
guyben 2017-12-20 12:06:39 -08:00 committed by Ben McIlwain
parent eb07768200
commit 2c96633a20
9 changed files with 21 additions and 16 deletions

View file

@ -41,6 +41,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Ordering;
import com.google.common.collect.Streams;
import com.googlecode.objectify.Key;
import google.registry.flows.EppException;
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
@ -262,7 +263,7 @@ public class DomainTransferApproveFlowTest
.build();
assertBillingEventsForResource(
domain,
Stream.concat(
Streams.concat(
Arrays.stream(expectedCancellationBillingEvents)
.map(builder -> builder.setParent(historyEntryTransferApproved).build()),
Stream.of(
@ -298,7 +299,7 @@ public class DomainTransferApproveFlowTest
// for the gaining client that begins at the new expiration time.
assertBillingEventsForResource(
domain,
Stream.concat(
Streams.concat(
Arrays.stream(expectedCancellationBillingEvents)
.map(builder -> builder.setParent(historyEntryTransferApproved).build()),
Stream.of(

View file

@ -48,6 +48,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Streams;
import com.googlecode.objectify.Key;
import google.registry.flows.EppException;
import google.registry.flows.EppRequestSource;
@ -313,7 +314,7 @@ public class DomainTransferRequestFlowTest
.collect(toImmutableSet());
// Assert that the billing events we constructed above actually exist in Datastore.
ImmutableSet<BillingEvent> expectedBillingEvents =
Stream.concat(
Streams.concat(
Stream.of(losingClientAutorenew, gainingClientAutorenew),
optionalToStream(optionalTransferBillingEvent))
.collect(toImmutableSet());
@ -332,7 +333,7 @@ public class DomainTransferRequestFlowTest
// Assert that the full set of server-approve billing events is exactly the extra ones plus
// the transfer billing event (if present) and the gaining client autorenew.
ImmutableSet<BillingEvent> expectedServeApproveBillingEvents =
Stream.concat(
Streams.concat(
Stream.of(gainingClientAutorenew), optionalToStream(optionalTransferBillingEvent))
.collect(toImmutableSet());
assertBillingEventsEqual(

View file

@ -33,6 +33,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Ordering;
import com.google.common.collect.Streams;
import com.googlecode.objectify.Key;
import google.registry.model.EntityTestCase;
import google.registry.model.billing.BillingEvent;
@ -51,7 +52,6 @@ import google.registry.model.registry.Registry;
import google.registry.model.reporting.HistoryEntry;
import google.registry.model.transfer.TransferData;
import google.registry.model.transfer.TransferStatus;
import java.util.stream.Stream;
import org.joda.money.Money;
import org.joda.time.DateTime;
import org.junit.Before;
@ -369,7 +369,7 @@ public class DomainResourceTest extends EntityTestCase {
domain
.asBuilder()
.setGracePeriods(
Stream.concat(addGracePeriods.stream(), renewGracePeriods.stream())
Streams.concat(addGracePeriods.stream(), renewGracePeriods.stream())
.collect(toImmutableSet()))
.build();
assertThat(domain.getGracePeriodsOfType(GracePeriodStatus.ADD)).isEqualTo(addGracePeriods);