InMemoryDataMatrix implements DataMatrix { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InMemoryDataMatrix)) return false; InMemoryDataMatrix that = (InMemoryDataMatrix) o; return Objects.equals(matrix, that.matrix) && Objects.equals(entrezIdToRowIndex, that.entrezIdToRowIndex); } 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 testEquals() { InMemoryDataMatrix identicalMatrix = new InMemoryDataMatrix(floatMatrix, entrezIdToRowIndex); assertThat(instance, equalTo(identicalMatrix)); }