Code example for FluentIterable

Methods: from

0
      NovaApi api = createMock(NovaApi.class);
      FloatingIPApi ipApi = createMock(FloatingIPApi.class);
 
      expect(api.getFloatingIPApi("region")).andReturn((Optional) Optional.of(ipApi)).atLeastOnce();
 
      expect(ipApi.list()).andReturn((FluentIterable) FluentIterable.from(ImmutableSet.<FloatingIP> of()))
      .atLeastOnce(); 
 
      replay(api);
      replay(ipApi);
 
      LoadFloatingIpsForInstance parser = new LoadFloatingIpsForInstance(api);
 
      assertFalse(parser.load(RegionAndId.fromRegionAndId("region", "i-blah")).iterator().hasNext());
 
      verify(api);
      verify(ipApi);
 
   } 
 
Contextual code suggestions in your IDE  Get Codota for Java