@Override
 public boolean apply(String input) {
   checkNotNull(input, "snapshot id");
   return api.snapshotApi()
       .get(input)
       .metadata()
       .state()
       .toString()
       .equals(expectedState.toString());
 }
 @Override
 public Provisionable getImage(String id) {
   // try search images
   logger.trace("<< searching for image with id=%s", id);
   Image image = api.imageApi().getImage(id);
   if (image != null) {
     logger.trace(">> found image [%s].", image.properties().name());
     return image;
   }
   // try search snapshots
   logger.trace("<< not found from images. searching for snapshot with id=%s", id);
   Snapshot snapshot = api.snapshotApi().get(id);
   if (snapshot != null) {
     logger.trace(">> found snapshot [%s]", snapshot.properties().name());
     return snapshot;
   }
   throw new ResourceNotFoundException("No image/snapshot with id '" + id + "' was found");
 }