### Question:
ProfileToNetwork { public static Matrix binaryProfile(Matrix profile, int k) { transformBinaryProfile(profile); return continuousProfile(profile, k); }  static Matrix continuousProfile(Matrix profile, int k); static Matrix continuousProfile(Matrix profile, int k, double maxMissingPercentage); static Object [] continuousProfileWithNames(Matrix profile, int k, String [] names, Map<String, String> identifierMap, double maxMissingPercentage); static Matrix ThresholdOnly(Matrix profile, double low, double hi); static double sillyColumnMult(Matrix terms, int i, int j); static void setHiLow(Matrix network, Matrix correlations, int i, double hi, double low); static Matrix binaryProfile(Matrix profile, int k); static Object[] averageRepeatedIdentifiers(Matrix profile, String [] names, Map<String, String> identifierMap); static void findNaNs(Matrix m); static void findNaNs(Vector v); static void convertProfileToRanks(Matrix profile);  }### Answer:
@Test public void testBinaryProfile() { Matrix profile = new DenseMatrix(new double [][] {{1,1,1,0,0},{1,1,0,1,1},{0,1,1,0,1},{1,0,1,1,0},{0,1,1,0,1}}); Matrix network = ProfileToNetwork.binaryProfile(profile, 3); assertNotNull(network); assertEquals(5, network.numRows()); assertEquals(5, network.numColumns()); Matrix expectedNetwork = new DenseMatrix(new double [][] { { 0.0000,-0.5442,-0.2579, 0.6125, 0.0000}, {-0.5442, 0.0000,-0.0499, 0.0000, 0.5700}, {-0.2579,-0.0499, 0.0000, 0.0000,-0.2579}, { 0.6125, 0.0000, 0.0000, 0.0000,-0.3583}, { 0.0000, 0.5700,-0.2579,-0.3583, 0.0000}, }); Utils.elementWiseCompare(expectedNetwork, network, 0.0001d); }