### Question:
DatacenterToLocation implements Function<Datacenter, Location> { @Inject public DatacenterToLocation(JustProvider provider) { this.provider = checkNotNull(provider, "provider"); } @Inject  DatacenterToLocation(JustProvider provider); @Override Location apply(Datacenter datacenter);  }### Answer:
@Test public void testDatacenterToLocation() { Address address = Address.builder().country("US").state("TX").description("This is Texas!").build(); Datacenter datacenter = Datacenter.builder().id(1).name("Texas").longName("Texas Datacenter") .locationAddress(address).build(); Location location = function.apply(datacenter); assertEquals(location.getId(), datacenter.getName()); Set<String> iso3166Codes = location.getIso3166Codes(); assertEquals(iso3166Codes.size(), 1); assertTrue(iso3166Codes.contains("US-TX")); }