### Question:
ConfusionMatrix { public static double calculateMatthewsCorrelationCoefficient(int tp, int tn, int fp, int fn) { double denominator = sqrt(tp + fp) * sqrt(tp + fn) * sqrt(tn + fp) * sqrt(tn + fn); long numerator = (long) tp * tn - (long) fp * fn; return denominator != 0 ? numerator / denominator : 0; } ConfusionMatrix(); void add(String realCategory, String predictedCategory); void add(String realCategory, String predictedCategory, int count); double getAccuracy(); int getTotalCorrect(); int getCorrectlyClassifiedDocuments(String category); int getClassifiedDocuments(String category); int getRealDocuments(String category); int getConfusions(String realCategory, String predictedCategory); Set<String> getCategories(); int getTotalDocuments(); double getHighestPrior(); double getSuperiority(); double getPrecision(String category); double getRecall(String category); double getF(double alpha, String category); double getSensitivity(String category); double getSpecificity(String category); double getAccuracy(String category); double getPrior(String category); double getAveragePrecision(boolean weighted); double getAverageRecall(boolean weighted); double getAverageF(double alpha, boolean weighted); double getAverageSensitivity(boolean weighted); double getAverageSpecificity(boolean weighted); @Deprecated double getAverageAccuracy(boolean weighted); double getMatthewsCorrelationCoefficient(); static double calculateMatthewsCorrelationCoefficient(int tp, int tn, int fp, int fn); @Override String toString();  }### Answer:
@Test public void testCalculateMcc() { int tp = 5363; int tn = 1176868; int fp = 0; int fn = 1516; double mcc = ConfusionMatrix.calculateMatthewsCorrelationCoefficient(tp, tn, fp, fn); assertEquals(0.8823922851, mcc, DELTA); }