List<CaretState> () { List<CaretState> caretsAndSelections = myDelegate.getCaretsAndSelections(); List<CaretState> convertedStates = new ArrayList<>(caretsAndSelections.size()); for (CaretState state : caretsAndSelections) { convertedStates.add(new CaretState(hostToInjected(state.getCaretPosition()), hostToInjected(state.getSelectionStart()), hostToInjected(state.getSelectionEnd()))); } return convertedStates; }