FirstRegion implements ImplicitLocationSupplier { @Inject FirstRegion(@Memoized Supplier<Set<? extends Location>> locationsSupplier) { this.locationsSupplier = checkNotNull(locationsSupplier, "locationsSupplierSupplier"); } @Inject  FirstRegion(@Memoized Supplier<Set<? extends Location>> locationsSupplier); @Override Location get();  }
@Test public void testFirstRegion() { Supplier<Set<? extends Location>> supplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet .<Location> of(provider, region, zone)); FirstRegion fn = new FirstRegion(supplier); assertEquals(fn.get(), region); }