Source:
<code>public static GridBodyCellEditContext makeCellRenderContext(final GridWidget gridWidget, final BaseGridRendererHelper.RenderingInformation ri, final BaseGridRendererHelper.ColumnInformation ci, final int uiRowIndex) { final GridColumn<?> column = ci.getColumn(); final GridRenderer renderer = gridWidget.getRenderer(); <START> final Group header = gridWidget.getHeader(); <END> final double headerRowsYOffset = ri.getHeaderRowsYOffset(); final double headerMinY = (header == null ? headerRowsYOffset : header.getY() + headerRowsYOffset); final double headerRowHeight = ri.getHeaderRowsHeight() / column.getHeaderMetaData().size(); final double headerRowsHeight = (headerRowHeight * column.getHeaderMetaData().size()); double rowsHeight = 0; for (int i = 0; i < uiRowIndex; i++) { rowsHeight += gridWidget.getModel().getRow(i).getHeight(); } final double cellX = gridWidget.getAbsoluteX() + ci.getOffsetX() + ci.getColumn().getWidth() / 2; final double lastCellYMiddle = gridWidget.getModel().getRow(uiRowIndex).getHeight() / 2; final double cellY = gridWidget.getAbsoluteY() + headerMinY + headerRowsHeight + rowsHeight + lastCellYMiddle; final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = ri.getFloatingBlockInformation(); final double floatingX = floatingBlockInformation.getX(); final double floatingWidth = floatingBlockInformation.getWidth(); final double clipMinX = gridWidget.getAbsoluteX() + floatingX + floatingWidth; final double clipMinY = gridWidget.getAbsoluteY(); final double blockCellWidth = column.getWidth(); return new GridBodyCellEditContext(cellX, cellY, blockCellWidth, headerRowHeight, clipMinY, clipMinX, uiRowIndex, ci.getUiColumnIndex(), floatingBlockInformation.getColumns().contains(column), gridWidget.getViewport().getTransform(), renderer, Optional.empty()); }</code><technical_language>I understand separated specific methods, is good. is led code duplication in class. In Ide, lines 37-43 93-99, 55-59 equals 104-108. Please isolate in single methods, ease future maintainability</technical_language>

Target:
public static GridBodyCellEditContext makeCellRenderContext(final GridWidget gridWidget, final BaseGridRendererHelper.RenderingInformation ri, final BaseGridRendererHelper.ColumnInformation ci, final int uiRowIndex) { final GridColumn<?> column = ci.getColumn(); final GridRenderer renderer = gridWidget.getRenderer(); final GridRow gridRow = gridWidget.getModel().getRow(uiRowIndex); final double headerRowsHeight = ri.getHeaderRowsHeight(); final double rowYOffset = gridWidget.getRendererHelper().getRowOffset(gridRow); final double cellX = getCellX(gridWidget, ci); final double cellY = getHeaderY(gridWidget, ri) + headerRowsHeight + rowYOffset; final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = ri.getFloatingBlockInformation(); final double clipMinX = getClipMinX(gridWidget, floatingBlockInformation); final double clipMinY = getClipMinY(gridWidget); final double blockCellWidth = column.getWidth(); final double blockCellHeight = gridRow.getHeight(); return new GridBodyCellEditContext(cellX, cellY, blockCellWidth, blockCellHeight, clipMinY, clipMinX, uiRowIndex, ci.getUiColumnIndex(), floatingBlockInformation.getColumns().contains(column), gridWidget.getViewport().getTransform(), renderer, Optional.empty()); }