### Question:
Main { static List<ExternalDc> getExternalDcs(Map<String, String> dcOpts) { final List<ExternalDc> externalDcs = newArrayList(); for (final String key: dcOpts.keySet()) { externalDcs.add( ExternalDc.newBuilder() .setName(key) .setUrl(dcOpts.get(key)) .build() ); } return externalDcs; }  static void main(final String[] args);  }### Answer:
@Test public void testGetExternalDcs() { Map<String, String> opts = Maps.newLinkedHashMap(); opts.put("dc0", "http: opts.put("dc1", "http: List<ExternalDc> dcs = Main.getExternalDcs(opts); assertEquals(2, dcs.size()); ExternalDc dc0 = dcs.get(0); assertEquals("dc0", dc0.getName()); assertEquals("http: }