Region implements Serializable, Comparable<Region> { public static Region[] values() { if (!hasUsedInstanceMetadataService && !hasWarnedAboutValuesWithoutInstanceMetadataService) { LOG.warn( "Call to Regions.values() without having contacted IMDS (Instance Metadata Service, only " + "available on OCI instances); if you do need the region from IMDS, call " + "Region.registerFromInstanceMetadataService before calling Region.values()"); hasWarnedAboutValuesWithoutInstanceMetadataService = true; } registerAllRegions(); synchronized (KNOWN_REGIONS) { return KNOWN_REGIONS.values().toArray(new Region[0]); } } private  Region(
            @NonNull String regionId, @NonNull Optional<String> regionCode, @NonNull Realm realm); String getRegionCode(); Optional<String> getEndpoint(Service service); int compareTo(Region other); @Override // For backward compatibility maintain the enum toString behavior String toString(); static Region[] values(); static Region valueOf(@NonNull String name); static String formatDefaultRegionEndpoint(Service service, Region region); static String formatDefaultRegionEndpoint(Service service, String regionId); static Region fromRegionId(String regionId); static Region fromRegionCode(String regionCode); static Region fromRegionCodeOrId(String regionCodeOrId); static Region register(@NonNull String regionId, @NonNull final Realm realm); static Region register(
            @NonNull String regionId, @NonNull final Realm realm, String regionCode); static void setInstanceMetadataServiceClientConfig(ClientConfig clientConfig); static void enableInstanceMetadataService(); static void skipInstanceMetadataService(); static boolean registerFromInstanceMetadataService(); static final Region AP_CHUNCHEON_1; static final Region AP_MELBOURNE_1; static final Region AP_HYDERABAD_1; static final Region AP_MUMBAI_1; static final Region AP_OSAKA_1; static final Region AP_SEOUL_1; static final Region AP_SYDNEY_1; static final Region AP_TOKYO_1; static final Region CA_MONTREAL_1; static final Region CA_TORONTO_1; static final Region EU_AMSTERDAM_1; static final Region EU_FRANKFURT_1; static final Region EU_ZURICH_1; static final Region ME_JEDDAH_1; static final Region ME_DUBAI_1; static final Region SA_SAOPAULO_1; static final Region UK_LONDON_1; static final Region US_ASHBURN_1; static final Region US_PHOENIX_1; static final Region US_SANJOSE_1; static final Region US_LANGLEY_1; static final Region US_LUKE_1; static final Region US_GOV_ASHBURN_1; static final Region US_GOV_CHICAGO_1; static final Region US_GOV_PHOENIX_1; static final Region UK_GOV_LONDON_1; static final Region UK_GOV_CARDIFF_1; static final Region AP_CHIYODA_1; }
@Test public void noDuplicateRegionId() { Set<String> regionIds = new HashSet<>(); for (Region region : Region.values()) { assertFalse(regionIds.contains(region.getRegionId())); regionIds.add(region.getRegionId()); } }
@Test(timeout = 5000L) public void testValues() { Region.values(); }