class GridInfo {

  @AndroidCoordinate
  static int[] initLineLocations(int layoutSize, int gridInfoSize, int[] axisLocations) {
    int difference = layoutSize - gridInfoSize;
    int lineLocationsLength = difference > 0 ? axisLocations.length + difference / NEW_CELL_SIZE : axisLocations.length;

    int startIndex;
    int[] lineLocations = Arrays.copyOf(axisLocations, lineLocationsLength);

    if (axisLocations.length == 0) {
      startIndex = 1;
    }
    else {
      lineLocations[axisLocations.length - 1] = gridInfoSize;
      startIndex = axisLocations.length;
    }

    for (int i = startIndex; i < lineLocationsLength; i++) {
      lineLocations[i] = lineLocations[i - 1] + NEW_CELL_SIZE;
    }

    if (lineLocations[lineLocations.length - 1] != layoutSize) {
      lineLocations = Arrays.copyOf(lineLocations, lineLocations.length + 1);
    }

    lineLocations[lineLocations.length - 1] = layoutSize - 1;
    return lineLocations;
  }

    GridInfo(NlComponent layout);

}