First of all, thank you for your help.
Now, I don't know how to implement the method "hasConnection" that you
use in the sanityCheck method. The fields "source" and "target" are both
of kind "EditPart", and in this class there isn't a method called
"hasConnection". What can I do?
Thank you very much.