### Question:
MultiLocation extends AbstractLocation implements MachineProvisioningLocation<T> { public T obtain() throws NoMachinesAvailableException { return obtain(MutableMap.of()); }  @Override void init(); T obtain(); @SuppressWarnings("unchecked") @Override T obtain(Map<?, ?> flags); List<MachineProvisioningLocation<?>> getSubLocations(); @SuppressWarnings("unchecked") @Override MachineProvisioningLocation<T> newSubLocation(Map<?, ?> newFlags); @SuppressWarnings("unchecked") @Override void release(T machine); @Override Map<String, Object> getProvisioningFlags(Collection<String> tags); @SuppressWarnings("serial")
    @SetFromFlag("subLocations")
    static final ConfigKey<List<MachineProvisioningLocation<?>>> SUB_LOCATIONS; }### Answer:
@Test public void testObtainsMovesThroughSubLocations() throws Exception { Assert.assertEquals(multiLoc.obtain().getAddress().getHostAddress(), "1.1.1.1"); Assert.assertEquals(multiLoc.obtain().getAddress().getHostAddress(), "1.1.1.2"); Assert.assertEquals(multiLoc.obtain().getAddress().getHostAddress(), "1.1.1.3"); Assert.assertEquals(multiLoc.obtain().getAddress().getHostAddress(), "1.1.1.4"); try { multiLoc.obtain(); Assert.fail(); } catch (NoMachinesAvailableException e) { log.info("Error when no machines available across locations is: "+e); Assert.assertTrue(e.toString().contains("loc1"), "Message should have referred to sub-location message: "+e); } }