*/
private Optional<OWLEntityData> getMatchingEntity(List<EntityLookupResult> result, String text, ProjectId projectId, Set<EntityType<?>> allowedEntityTypes) {
if (result.isEmpty()) {
return Optional.absent();
}
EntityLookupResult lookupResult = result.get(0);
final OWLEntityData lookedUpEntityData = lookupResult.getOWLEntityData();
EntityType<?> entityType = lookedUpEntityData.getEntity().getEntityType();
if (lookedUpEntityData.getBrowserText().equalsIgnoreCase(text) && allowedEntityTypes.contains(entityType)) {
return Optional.of(lookedUpEntityData);
}
else {