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);   }
@Test public void initLineLocations() { int[] actual = GridInfo.initLineLocations(718, 496, new int[]{0, 248, 718}); assertArrayEquals(new int[]{0, 248, 496, 528, 560, 592, 624, 656, 688, 717}, actual); }
@Test public void initLineLocationsDifferenceModNewCellSizeEqualsZero() { int[] actual = GridInfo.initLineLocations(718, 526, new int[]{0, 248, 718}); assertArrayEquals(new int[]{0, 248, 526, 558, 590, 622, 654, 686, 717}, actual); }