for (UserSelection userSelection : userSelections.values()) {
if (userSelection.resourceId.equals(resourceId)) {
Anchor cursorAnchor = userSelection.cursorAnchor;
Anchor baseAnchor = userSelection.baseAnchor;
if (cursorAnchor != null && baseAnchor != null) {
FilePositionImpl basePosition = FilePositionImpl.make()
.setColumn(baseAnchor.getColumn()).setLineNumber(baseAnchor.getLineNumber());
FilePositionImpl cursorPosition = FilePositionImpl.make().setColumn(
cursorAnchor.getColumn()).setLineNumber(cursorAnchor.getLineNumber());
DocumentSelectionImpl selection = DocumentSelectionImpl.make()
.setUserId(userSelection.clientId).setBasePosition(basePosition)
.setCursorPosition(cursorPosition);
selections.add(selection);