@Test(expected = IllegalArgumentException.class) public void testFindOriginalGatewayEmpty() { TransitGatewayConverter.findOriginalGateway(ImmutableList.of()); }
@VisibleForTesting @Nullable static TransitGatewayWithMetadata findOriginalGateway( Collection<TransitGatewayWithMetadata> tgws) { checkArgument(!tgws.isEmpty()); checkArgument( tgws.stream().map(TransitGatewayWithMetadata::getTransitGatewayId).distinct().count() == 1); if (tgws.size() == 1) { return tgws.iterator().next(); } return tgws.stream().filter(TransitGatewayWithMetadata::isOriginal).findFirst().orElse(null); }
TransitGatewayConverter { @VisibleForTesting @Nullable static TransitGatewayWithMetadata findOriginalGateway( Collection<TransitGatewayWithMetadata> tgws) { checkArgument(!tgws.isEmpty()); checkArgument( tgws.stream().map(TransitGatewayWithMetadata::getTransitGatewayId).distinct().count() == 1); if (tgws.size() == 1) { return tgws.iterator().next(); } return tgws.stream().filter(TransitGatewayWithMetadata::isOriginal).findFirst().orElse(null); } }
TransitGatewayConverter { @VisibleForTesting @Nullable static TransitGatewayWithMetadata findOriginalGateway( Collection<TransitGatewayWithMetadata> tgws) { checkArgument(!tgws.isEmpty()); checkArgument( tgws.stream().map(TransitGatewayWithMetadata::getTransitGatewayId).distinct().count() == 1); if (tgws.size() == 1) { return tgws.iterator().next(); } return tgws.stream().filter(TransitGatewayWithMetadata::isOriginal).findFirst().orElse(null); } private  TransitGatewayConverter(); }
TransitGatewayConverter { @VisibleForTesting @Nullable static TransitGatewayWithMetadata findOriginalGateway( Collection<TransitGatewayWithMetadata> tgws) { checkArgument(!tgws.isEmpty()); checkArgument( tgws.stream().map(TransitGatewayWithMetadata::getTransitGatewayId).distinct().count() == 1); if (tgws.size() == 1) { return tgws.iterator().next(); } return tgws.stream().filter(TransitGatewayWithMetadata::isOriginal).findFirst().orElse(null); } private  TransitGatewayConverter(); static List<Configuration> convertTransitGateways(
      AwsConfiguration awsConfiguration, ConvertedConfiguration configs); }
TransitGatewayConverter { @VisibleForTesting @Nullable static TransitGatewayWithMetadata findOriginalGateway( Collection<TransitGatewayWithMetadata> tgws) { checkArgument(!tgws.isEmpty()); checkArgument( tgws.stream().map(TransitGatewayWithMetadata::getTransitGatewayId).distinct().count() == 1); if (tgws.size() == 1) { return tgws.iterator().next(); } return tgws.stream().filter(TransitGatewayWithMetadata::isOriginal).findFirst().orElse(null); } private  TransitGatewayConverter(); static List<Configuration> convertTransitGateways(
      AwsConfiguration awsConfiguration, ConvertedConfiguration configs);  }