public void testDeleteComment() throws Exception {
    Comment c = new Comment();
    c.setAuthor("lolcat");
    c.setContent("Can I haz ID?");
    c.setTargetId(UUID.randomUUID());
    c.setId(UUID.randomUUID());

    boolean result = es.putComment(c);
    assertTrue(es.getErrorMessage(), result);

    System.out.println("Comment ID: " + c.getId());

    result = es.deleteComment(c.getId());
    assertTrue(es.getErrorMessage(), result);
  }
  public void testGetComments() throws Exception {
    List<Comment> comments = new ArrayList<Comment>();
    List<Comment> returned = new ArrayList<Comment>();
    UUID targetId = UUID.randomUUID();

    for (int i = 0; i < 5; i++) {
      comments.add(createComment(i, targetId));
    }

    for (Comment c : comments) {
      boolean result = es.putComment(c);
      assertTrue(es.getErrorMessage(), result);
    }

    // give elasticsearch some time to sort out its life issues
    Thread.sleep(4000);

    returned = es.getComments(targetId, 0, 10);

    assertEquals(
        "Lists different size!, " + es.getErrorMessage(), comments.size(), returned.size());

    for (Comment c : returned) {
      try {
        es.deleteComment(c.getId());
      } catch (Exception e) {

      }
    }

    for (Comment c : comments) {
      assertTrue("Comment missing from results", returned.contains(c));
    }

    for (Comment c : returned) {
      assertEquals(c.getId(), c.getImage().getId());
      assertNotNull(c.getImage().getEncodedBitmap());
    }
  }