/** * Return the proper instance of the interactor if the database is recognized (the interactor will be returned on the first database which is recognized). It returns null otherwise. * @param xrefs : identifiers * @param name : name * @return the proper instance of the interactor if the database is recognized (the interactor will be returned on the first database which is recognized). It returns null otherwise. */ public Interactor createInteractorFromIdentityXrefs(Collection<? extends Xref> xrefs, String name){ Interactor interactor = null; Iterator<? extends Xref> xrefsIterator = xrefs.iterator(); while (interactor == null && xrefsIterator.hasNext()){ interactor = createInteractorFromDatabase(xrefsIterator.next().getDatabase(), name); } return interactor; }