expect(api.getKeyPairExtensionForZone("zone")).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();
expect(uniqueIdSupplier.get()).andReturn("1");
expect(keyApi.create("group-1")).andThrow(new IllegalStateException());
expect(uniqueIdSupplier.get()).andReturn("2");
expect(keyApi.create("group-2")).andReturn(pair);
replay(api, keyApi, uniqueIdSupplier);
CreateUniqueKeyPair parser = Guice.createInjector(new AbstractModule() {