@Test
public void testGetAnnotationsByTypeAndMediapackageId() throws Exception {

  String type = "a type of annotation, such as 'bookmark' or 'note'";
  // Add an annotation
  AnnotationImpl a1 = new AnnotationImpl();
  a1.setType(type);
  a1.setInpoint(10);
  a1.setOutpoint(100);
  a1.setMediapackageId("mp");
  a1.setSessionId("session");
  a1.setValue("This is some user generated content");
  annotationService.addAnnotation(a1);
  // Add another annotation of the same type to a different mediapackage
  AnnotationImpl a2 = new AnnotationImpl();
  a2.setType(type);
  a2.setInpoint(10);
  a2.setOutpoint(100);
  a2.setMediapackageId("a different mediapackage");
  a2.setSessionId("a different session");
  a2.setValue("More user generated content");
  annotationService.addAnnotation(a2);
  AnnotationList annotations = annotationService.getAnnotationsByTypeAndMediapackageId(type, "mp", 0, 100);
  Assert.assertEquals(1, annotations.getAnnotations().size());
}