# Compare annotations The page describes how to compare annotations. GroupDocs.Annotation v21.7. and later allows you to compare annotations using the `Equals` method. The following code snippet shows how to compare annotations: {{< tabs "example1">}} {{< tab "Java" >}} ```java // This example demonstrates how to update annotation. // Create an instance of Annotator class try (Annotator annotator = new Annotator("annotated_file.pdf")) { List annotations = annotator.get(); // Create an instance of the ImageAnnotation class and add options ImageAnnotation imageAnnotation = new ImageAnnotation(); imageAnnotation.setBox(new Rectangle(100, 100, 100, 100)); imageAnnotation.setOpacity(0.7); imageAnnotation.setPageNumber(0); imageAnnotation.setImagePath("www.google.com.ua/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png"); imageAnnotation.setAngle(100.0); for(int i = 0; i < annotations.size(); i++) { // Compare annotations if (imageAnnotation.equals(annotations.get(i))) { // Do some stuff here... } } } ``` {{< /tab >}} {{< /tabs >}}