public RegionsResponse getAvailableRegions() {

        List<AWSRegion> regions =
                Region.regions().stream()
                        // Ignore the global region. CloudWatch and Kinesis cannot be used with global regions.
                        .filter(r -> !r.isGlobalRegion())
                        .map(r -> {
                            // Build a single AWSRegionResponse with id, description, and displayValue.
                            RegionMetadata regionMetadata = r.metadata();
                            String label = String.format(Locale.ROOT, "%s: %s", regionMetadata.description(), regionMetadata.id());
                            return AWSRegion.create(regionMetadata.id(), label);
                        })
                        .sorted(Comparator.comparing(AWSRegion::regionId))
                        .collect(Collectors.toList());

        return RegionsResponse.create(regions, regions.size());
    }
@Test
    public void regionTest() {

        List<AWSRegion> regions = awsService.getAvailableRegions().regions();

        // Use a loop presence check.
        // Check format of random region.
        boolean foundEuWestRegion = false;
        for (AWSRegion availableAWSRegion : regions) {

            if (availableAWSRegion.regionId().equals("eu-west-2")) {
                foundEuWestRegion = true;
            }
        }
        assertTrue(foundEuWestRegion);
        assertTrue(regions.stream().anyMatch(r -> r.displayValue().equals("Europe (Stockholm): eu-north-1")));
        // AWS periodically adds regions. The number should generally only increase. No need to check exact number.
        assertTrue("There should be at least 34 total regions.", regions.size() >= 34);
    }