private TermMentionWithGraphVertex findTermMentionWithGraphVertex( List<TermMentionWithGraphVertex> termMentionsWithGraphVertices, TermMention termMention) { for (TermMentionWithGraphVertex termMentionsWithGraphVertex : termMentionsWithGraphVertices) { if (termMentionsWithGraphVertex.getTermMention().getRowKey().getStartOffset() == termMention.getStart() && termMentionsWithGraphVertex.getTermMention().getRowKey().getEndOffset() == termMention.getEnd() && termMentionsWithGraphVertex.getVertex() != null) { return termMentionsWithGraphVertex; } } return null; }