public Collection<Reference> getIncomingReferencesByType(Class<? extends ModelElementInstance> referenceSourceTypeClass) {
Collection<Reference> references = new ArrayList<Reference>();
// we traverse all incoming references in reverse direction
for (Reference<?> reference : idAttribute.getIncomingReferences()) {
ModelElementType sourceElementType = reference.getReferenceSourceElementType();
Class<? extends ModelElementInstance> sourceInstanceType = sourceElementType.getInstanceType();
// if the referencing element (source element) is a BPMNDI element, dig deeper
if (referenceSourceTypeClass.isAssignableFrom(sourceInstanceType)) {
references.add(reference);
}