Couple<Integer> ( final int[] x, final int[] y, final int[] rowSpans, final int[] colSpans ) { LOG.assertTrue(x.length == y.length); LOG.assertTrue(y.length == colSpans.length); LOG.assertTrue(colSpans.length == rowSpans.length); for (int i = 0; i < x.length; i++) { colSpans[i] = Math.max(colSpans[i], 1); rowSpans[i] = Math.max(rowSpans[i], 1); if (colSpans[i] > GRID_TREMOR * 4) { colSpans[i] -= GRID_TREMOR * 2; x[i] += GRID_TREMOR; } if (rowSpans[i] > GRID_TREMOR * 4) { rowSpans[i] -= GRID_TREMOR * 2; y[i] += GRID_TREMOR; } } return Couple.of( Integer.valueOf(Util.eliminate(y, rowSpans, null)), Integer.valueOf(Util.eliminate(x, colSpans, null)) ); }