# Get list of changes This article explains how to get collection of changes between compared documents when using GroupDocs.Comparison for Java. [GroupDocs.Comparison](https://products.groupdocs.com/comparison/java) allows you to get list of changes between source and target documents. To get list of changes, follow these steps: 1. Instantiate the [Comparer](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer) object. Specify the source document path or stream. 2. Call the [add()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#add-java.lang.String-) method. Specify the target document path or stream. 3. Call the [compare()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#compare-java.lang.String-) method. 4. Call the [getChanges](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#getChanges--) method. The following code snippets show how to get list of all changes: ## Get list of changes from local disk {{< tabs "example1">}} {{< tab "Java" >}} ```java import com.groupdocs.comparison.Comparer; import com.groupdocs.comparison.result.ChangeInfo; // ... try (Comparer comparer = new Comparer("source.docx")) { comparer.add("target.docx"); comparer.compare(); ChangeInfo[] changes = comparer.getChanges(); for (ChangeInfo change : changes) { System.out.println("Change Type: " + change.getType() + ", Page: " + change.getPageInfo().getPageNumber() + ", Change ID: " + change.getId() + ", Text: " + change.getText()); } } ``` {{< /tab >}} {{< /tabs >}} The result is as follows: ![](https://docs.groupdocs.com/comparison/java/images/get-changes-list.png) ## Get list of changes from stream {{< tabs "example2">}} {{< tab "Java" >}} ```java import com.groupdocs.comparison.Comparer; import com.groupdocs.comparison.result.ChangeInfo; import java.io.FileInputStream; import java.io.InputStream; // ... try (final FileInputStream sourceInputStream = new FileInputStream("source.docx"); final Comparer comparer = new Comparer(sourceInputStream); final FileInputStream targetInputStream = new FileInputStream("target.docx")) { comparer.add(targetInputStream); comparer.compare(); ChangeInfo[] changes = comparer.getChanges(); for (ChangeInfo change : changes) { System.out.println("Change Type: " + change.getType() + ", Page: " + change.getPageInfo().getPageNumber() + ", Change ID: " + change.getId() + ", Text: " + change.getText()); } } ``` {{< /tab >}} {{< /tabs >}}