Source:
<code>public void testRemoveColumnsWithTooManyZeros(final ReadCountCollection readCount) { final RealMatrix counts = readCount.counts(); final int[] numberOfZeros = IntStream.range(0, counts.getColumnDimension()) .map(i -> (int) DoubleStream.of(counts.getColumn(i)).filter(d -> d == 0.0).count()).toArray(); final int maximumNumberOfZeros = IntStream.of(numberOfZeros).max().getAsInt(); for (int maxZeros = 0; maxZeros < maximumNumberOfZeros; maxZeros++) { final int maxZerosThres = maxZeros; final int expectedRemainingCount = (int) IntStream.of(numberOfZeros).filter(i -> i <= maxZerosThres).count(); if (expectedRemainingCount == 0) { try { CreatePanelOfNormals.removeColumnsWithTooManyZeros(readCount, maxZeros, NULL_LOGGER); } catch (final UserException.BadInput ex) { continue; } Assert.fail("expects an exception"); } final ReadCountCollection rc = CreatePanelOfNormals.removeColumnsWithTooManyZeros(readCount, maxZeros, NULL_LOGGER); Assert.assertEquals(rc.columnNames().size(), expectedRemainingCount); <START> final int[] newIndeces = new int[expectedRemainingCount]; <END> int nextIndex = 0; for (int i = 0; i < readCount.columnNames().size(); i++) { final String name = readCount.columnNames().get(i); final int newIndex = rc.columnNames().indexOf(name); if (numberOfZeros[i] <= maxZeros) { Assert.assertTrue(newIndex >= 0); newIndeces[nextIndex++] = i; } else { Assert.assertEquals(newIndex, -1); } } Assert.assertEquals(nextIndex, expectedRemainingCount); for (int i = 1; i < newIndeces.length; i++) { Assert.assertTrue(newIndeces[i - 1] < newIndeces[i]); } } }</code><technical_language>Spelling error -- newIndices</technical_language>

Target:
public void testRemoveColumnsWithTooManyZeros(final ReadCountCollection readCount) { final RealMatrix counts = readCount.counts(); final int[] numberOfZeros = IntStream.range(0, counts.getColumnDimension()) .map(i -> (int) DoubleStream.of(counts.getColumn(i)).filter(d -> d == 0.0).count()).toArray(); final int maximumNumberOfZeros = IntStream.of(numberOfZeros).max().getAsInt(); for (int maxZeros = 0; maxZeros < maximumNumberOfZeros; maxZeros++) { final int maxZerosThres = maxZeros; final int expectedRemainingCount = (int) IntStream.of(numberOfZeros).filter(i -> i <= maxZerosThres).count(); if (expectedRemainingCount == 0) { try { CreatePanelOfNormals.removeColumnsWithTooManyZeros(readCount, maxZeros, NULL_LOGGER); } catch (final UserException.BadInput ex) { continue; } Assert.fail("expects an exception"); } final ReadCountCollection rc = CreatePanelOfNormals.removeColumnsWithTooManyZeros(readCount, maxZeros, NULL_LOGGER); Assert.assertEquals(rc.columnNames().size(), expectedRemainingCount); final int[] newIndices = new int[expectedRemainingCount]; int nextIndex = 0; for (int i = 0; i < readCount.columnNames().size(); i++) { final String name = readCount.columnNames().get(i); final int newIndex = rc.columnNames().indexOf(name); if (numberOfZeros[i] <= maxZeros) { Assert.assertTrue(newIndex >= 0); newIndices[nextIndex++] = i; } else { Assert.assertEquals(newIndex, -1); } } Assert.assertEquals(nextIndex, expectedRemainingCount); for (int i = 1; i < newIndices.length; i++) { Assert.assertTrue(newIndices[i - 1] < newIndices[i]); } } }