@Test
public void testColoringChangedValue() throws Exception {

    Formatter formatter;
    String resultString;
    LoadRecord rec1, rec2;
    String expected;
    Map<Level, LoadRecord> loadMap;
    LoadRecord summary;
    Load load = new Load(new LevelClass(ServerName.class));
    // iteration 1
    loadMap = new TreeMap<>();
    rec1 = new LoadRecord();
    rec1.put(LoadEntry.MemstoreSize, 1);
    rec1.put(LoadEntry.Writes, 1);
    loadMap.put(new Level("rec1"), rec1);
    rec2 = new LoadRecord();
    rec2.put(LoadEntry.Writes, 2);
    loadMap.put(new Level("rec2"), rec2);
    summary = new LoadRecord();
    summary.put(LoadEntry.MemstoreSize, 1);
    summary.put(LoadEntry.Writes, 3);
    load.setLoadMap(loadMap);
    load.setSummary(summary);
    load.updateChangeMap();
    formatter = new Formatter("testTable", load);
    resultString = formatter.buildString(false, Formatter.Type.ANSI);
    System.out.println(resultString);
    expected = "\u001B[32mRegionServer\u001B[0m  \u001B[36mReads\u001B[0m      \u001B[36mWrites\u001B[0m   \u001B[36mRegions\u001B[0m    \u001B[36mFiles\u001B[0m      \u001B[36mFileSize\u001B[0m   \u001B[36mFileSizeUncomp\u001B[0m  \u001B[36mMemstoreSize\u001B[0m  \u001B[36mCompactedKVs\u001B[0m  \n" +
            "\u001B[1m rec1\u001B[0m         N/A | N/A  1 | N/A  N/A | N/A  N/A | N/A  N/A | N/A  N/A | N/A        1m | N/A     N/A | N/A     \n" +
            "\u001B[1m rec2\u001B[0m         N/A | N/A  2 | N/A  N/A | N/A  N/A | N/A  N/A | N/A  N/A | N/A       N/A | N/A     N/A | N/A     \n" +
            "\u001B[1m Total: 2\u001B[0m     N/A | N/A  3 | N/A  N/A | N/A  N/A | N/A  N/A | N/A  N/A | N/A        1m | N/A     N/A | N/A     \n";
    Assert.assertEquals(expected, resultString);
    // iteration 2
    load.prepare();
    loadMap = new TreeMap<>();
    rec1 = new LoadRecord();
    rec1.put(LoadEntry.MemstoreSize, 1);
    rec1.put(LoadEntry.Writes, 2);
    loadMap.put(new Level("rec1"), rec1);
    rec2 = new LoadRecord();
    rec2.put(LoadEntry.Writes, 2);
    loadMap.put(new Level("rec2"), rec2);
    summary = new LoadRecord();
    summary.put(LoadEntry.MemstoreSize, 1);
    summary.put(LoadEntry.Writes, 4);
    load.setLoadMap(loadMap);
    load.setSummary(summary);
    load.updateChangeMap();
    resultString = formatter.buildString(false, Formatter.Type.ANSI);
    System.out.println(resultString);
    expected = "\u001B[32mRegionServer\u001B[0m  \u001B[36mReads\u001B[0m      \u001B[36mWrites\u001B[0m  \u001B[36mRegions\u001B[0m    \u001B[36mFiles\u001B[0m      \u001B[36mFileSize\u001B[0m   \u001B[36mFileSizeUncomp\u001B[0m  \u001B[36mMemstoreSize\u001B[0m  \u001B[36mCompactedKVs\u001B[0m  \n" +
            "\u001B[1m rec1\u001B[0m         N/A | N/A  \u001B[33m2\u001B[0m | \u001B[33m1\u001B[0m   N/A | N/A  N/A | N/A  N/A | N/A  N/A | N/A        1m |  0m     N/A | N/A     \n" +
            "\u001B[1m rec2\u001B[0m         N/A | N/A  2 | 0   N/A | N/A  N/A | N/A  N/A | N/A  N/A | N/A       N/A | N/A     N/A | N/A     \n" +
            "\u001B[1m Total: 2\u001B[0m     N/A | N/A  \u001B[33m4\u001B[0m | \u001B[33m1\u001B[0m   N/A | N/A  N/A | N/A  N/A | N/A  N/A | N/A        1m |  0m     N/A | N/A     \n";
    Assert.assertEquals(expected, resultString);
}