Set<OWLEntity> result = new HashSet<OWLEntity>();
Set<IRI> iris = new HashSet<IRI>();
for (OWLOntologyChangeRecord change : changes) {
if (change.getData() instanceof AxiomChangeData) {
OWLAxiom ax = ((AxiomChangeData) change.getData()).getAxiom();
AxiomSubjectProvider axiomSubjectProvider = new AxiomSubjectProvider();
OWLObject object = axiomSubjectProvider.getSubject(ax);
if (object instanceof OWLEntity) {
result.add((OWLEntity) object);
}
else if (object instanceof IRI) {
iris.add((IRI) object);