@Test
public void testConvertToMap() throws Exception{

    String dataPath = "src/test/resources/prioritisers/";
    String indexPath = dataPath + "test_ppi_matrix_id2index.gz";
    String matrixPath = dataPath + "test_ppi_matrix.gz";
    Path matrixMapFile = Files.createTempFile("test_ppi_matrix", ".mv");
    DataMatrixIO.convertToMap(matrixPath, indexPath, matrixMapFile);
    // load the in memory version first as this copies all the data and closes the map otherwise it will throw an
    // IllegalStateException caused by an OverlappingFileLockException
    DataMatrix inMemoryMapMatrix = DataMatrixIO.loadInMemoryDataMatrix(matrixMapFile);
    DataMatrix offHeapMapMatrix = DataMatrixIO.loadOffHeapDataMatrix(matrixMapFile);
    DataMatrix fromFile = DataMatrixIO.loadInMemoryDataMatrixFromFile(matrixPath, indexPath, true);
    assertThat(offHeapMapMatrix.getEntrezIdToRowIndex(), equalTo(fromFile.getEntrezIdToRowIndex()));
    testMatrixEquality(offHeapMapMatrix.getMatrix(), fromFile.getMatrix());
    testMatrixEquality(inMemoryMapMatrix.getMatrix(), fromFile.getMatrix());
}