#vulnerable code 
                              @Test
  public void testMemoryPools() {
    assertEquals(
        500000L,
        registry.getSampleValue(
            MemoryPoolsExports.POOLS_USED_METRIC,
            new String[]{"pool"},
            new String[]{"PS-Eden-Space"}),
        .0000001);
    assertEquals(
        1000000L,
        registry.getSampleValue(
            MemoryPoolsExports.POOLS_LIMIT_METRIC,
            new String[]{"pool"},
            new String[]{"PS-Eden-Space"}),
        .0000001);
    assertEquals(
        10000L,
        registry.getSampleValue(
            MemoryPoolsExports.POOLS_USED_METRIC,
            new String[]{"pool"},
            new String[]{"PS-Old-Gen"}),
        .0000001);
    assertEquals(
        20000L,
        registry.getSampleValue(
            MemoryPoolsExports.POOLS_LIMIT_METRIC,
            new String[]{"pool"},
            new String[]{"PS-Old-Gen"}),
        .0000001);
  } 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Test
  public void testMemoryPools() {
    assertEquals(
        500000L,
        registry.getSampleValue(
            "jvm_memory_pool_bytes_used",
            new String[]{"pool"},
            new String[]{"PS Eden Space"}),
        .0000001);
    assertEquals(
        1000000L,
        registry.getSampleValue(
            "jvm_memory_pool_bytes_committed",
            new String[]{"pool"},
            new String[]{"PS Eden Space"}),
        .0000001);
    assertEquals(
        2000000L,
        registry.getSampleValue(
            "jvm_memory_pool_bytes_max",
            new String[]{"pool"},
            new String[]{"PS Eden Space"}),
        .0000001);
    assertEquals(
        10000L,
        registry.getSampleValue(
            "jvm_memory_pool_bytes_used",
            new String[]{"pool"},
            new String[]{"PS Old Gen"}),
        .0000001);
    assertEquals(
        20000L,
        registry.getSampleValue(
            "jvm_memory_pool_bytes_committed",
            new String[]{"pool"},
            new String[]{"PS Old Gen"}),
        .0000001);
    assertEquals(
        3000000L,
        registry.getSampleValue(
            "jvm_memory_pool_bytes_max",
            new String[]{"pool"},
            new String[]{"PS Old Gen"}),
        .0000001);
  }