expectLastCall().once();
managementContext.unregister(anyObject(Compute.class));
expectLastCall().once();
replay(managementContext);
Compute compute = ContextBuilder.newBuilder(new JcloudsTestComputeProviderMetadata()).name("testname")
.credentials("user", "password")
.modules(ImmutableSet.<Module>builder().add(new ManagementLifecycle(managementContext)).build()).build(Compute.class);
compute.unwrap().close();
verify(managementContext);
}