CompatibilityMatrix { void markRow(int i, int marking) { for (int j = (i * mCols), end = j + mCols; j < end; j++) if (data[j] > 0) data[j] = marking; } CompatibilityMatrix(int nRows, int mCols);   }
@Test public void markRow() throws Exception { CompatibilityMatrix m = new CompatibilityMatrix(5, 5); m.set(0, 1); m.set(0, 2); m.set(0, 4); assertThat(m.fix()[0], is(new int[]{0, 1, 1, 0, 1})); m.markRow(0, -1); assertThat(m.fix()[0], is(new int[]{0, -1, -1, 0, -1})); }