private void clear() {
        garbageCollectionTypeForwardReference = null;
        gcCauseForwardReference = GCCause.UNKNOWN_GCCAUSE;
        fullGCTimeStamp = null;
        scavengeTimeStamp = null;
        youngMemoryPoolSummaryForwardReference = null;
        tenuredForwardReference = null;
        heapForwardReference = null;
        scavengeDurationForwardReference = 0.0;
        scavengeCPUSummaryForwardReference = null;
        referenceGCForwardReference = null;
        totalFreeSpaceForwardReference = 0;
        maxChunkSizeForwardReference = 0;
        numberOfBlocksForwardReference = 0;
        averageBlockSizeForwardReference = 0;
        treeHeightForwardReference = 0;
    }
@Test
    public void testThat2CMFDoNotHappen() {
        String[][] lines = new String[][]{
                {
                        "57721.729: [GC [1 CMS-initial-mark: 763361K(786432K)] 767767K(1022400K), 0.0022735 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]",
                        "57721.732: [CMS-concurrent-mark-start]",
                        "57722.918: [GC 57722.918: [ParNew: 209792K->26176K(235968K), 0.0618431 secs] 973153K->802453K(1022400K), 0.0620347 secs] [Times: user=0.38 sys=0.00, real=0.06 secs]",
                        "57724.218: [Full GC 57724.218: [CMS2010-04-21T10:45:33.367+0100: 57724.319: [CMS-concurrent-mark: 2.519/2.587 secs] [Times: user=12.58 sys=0.09, real=2.59 secs]",
                        "(concurrent mode failure): 776277K->770654K(786432K), 6.0499857 secs] 1012245K->770654K(1022400K), [CMS Perm : 23211K->23211K(38736K)], 6.0501617 secs] [Times: user=6.09 sys=0.00, real=6.05 secs]"
                },
                {
                        "58272.354: [GC [1 CMS-initial-mark: 786431K(786432K)] 794666K(1022400K), 0.0088514 secs] [Times: user=0.01 sys=0.00, real=0.02 secs]",
                        "58272.363: [CMS-concurrent-mark-start]",
                        "58273.778: [Full GC 58273.778: [CMS2010-04-21T10:54:43.688+0100: 58274.663: [CMS-concurrent-mark: 2.299/2.300 secs] [Times: user=8.69 sys=0.11, real=2.30 secs]",
                        "(concurrent mode failure): 786431K->785452K(786432K), 6.5738696 secs] 1022399K->785452K(1022400K), [CMS Perm : 23211K->23211K(38736K)], 6.5740517 secs] [Times: user=7.44 sys=0.00, real=6.56 secs]"
                }
        };

        Class[][] eventTypes = {
                {InitialMark.class, ConcurrentMark.class, ParNew.class, ConcurrentModeFailure.class},
                {InitialMark.class, ConcurrentMark.class, ConcurrentModeFailure.class}
        };

        for (int i = 0; i < lines.length; i++) {
            List<JVMEvent> jvmEvents = feedParser(lines[i]);

            for (int j = 0; j < eventTypes[i].length; j++) {
                assertEquals(jvmEvents.get(j).getClass(), eventTypes[i][j]);
            }
            jvmEvents.clear();
        }
    }