@Test
public void cleanupFailedNodesNotEmpty() throws KaramelException {

  Map<NodeMetadata, Throwable> failedNodes = new HashMap<>();
  Throwable exception = mock(Throwable.class);
  NodeMetadata meta = mock(NodeMetadata.class);
  failedNodes.put(meta, exception);
  Set<NodeMetadata> destroyedNodes = new HashSet<>();
  destroyedNodes.add(meta);
  when(meta.getId()).thenReturn("20");
  doReturn(destroyedNodes).when(novaComputeService).destroyNodesMatching(Predicates.in(failedNodes.keySet()));
  NovaLauncher novaLauncher = new NovaLauncher(novaContext, sshKeyPair);
  boolean cleanupSuccessful = novaLauncher.cleanupFailedNodes(failedNodes);
  assertTrue(cleanupSuccessful);
}