public File dumpHeap()
      throws MalformedObjectNameException, InstanceNotFoundException, ReflectionException,
          MBeanException, IOException {
    return dumpHeap(localDumpFolder);
  }
@Test
  public void heapDumpTwice() throws Exception {
    File folder = tempFolder.newFolder();

    File dump1 = MemoryMonitor.dumpHeap(folder);
    assertNotNull(dump1);
    assertTrue(dump1.exists());
    assertThat(dump1.getParentFile(), Matchers.equalTo(folder));

    File dump2 = MemoryMonitor.dumpHeap(folder);
    assertNotNull(dump2);
    assertTrue(dump2.exists());
    assertThat(dump2.getParentFile(), Matchers.equalTo(folder));
  }