InMemoryDataMatrix implements DataMatrix { @Override public Integer getRowIndexForGene(int entrezGeneId) { return entrezIdToRowIndex.get(entrezGeneId); } InMemoryDataMatrix(FloatMatrix matrix, Map<Integer, Integer> entrezIdToRowIndex); static InMemoryDataMatrix fromMap(Map<Integer, float[]> columns, Map<Integer, Integer> entrezIdToRowIndex); @Override Map<Integer, Integer> getEntrezIdToRowIndex(); @Override FloatMatrix getMatrix(); @Override int numRows(); @Override int numColumns(); @Override boolean containsGene(Integer entrezGeneId); @Override Integer getRowIndexForGene(int entrezGeneId); @Override FloatMatrix getColumnMatrixForGene(int entrezGeneId); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testGetRowIndexForGeneInIndex() { assertThat(instance.getRowIndexForGene(3333), equalTo(3)); }
@Test public void testGetRowIndexForGeneNotInIndex() { assertThat(instance.getRowIndexForGene(9999), nullValue()); }