#vulnerable code 
                              @Test
  public void testMemoryAreas() {
    assertEquals(
        500000L,
        registry.getSampleValue(
            MemoryPoolsExports.MEMORY_USED_METRIC,
            new String[]{"area"},
            new String[]{"heap"}),
        .0000001);
    assertEquals(
        1000000L,
        registry.getSampleValue(
            MemoryPoolsExports.MEMORY_LIMIT_METRIC,
            new String[]{"area"},
            new String[]{"heap"}),
        .0000001);
    assertEquals(
        10000L,
        registry.getSampleValue(
            MemoryPoolsExports.MEMORY_USED_METRIC,
            new String[]{"area"},
            new String[]{"nonheap"}),
        .0000001);
    assertEquals(
        20000L,
        registry.getSampleValue(
            MemoryPoolsExports.MEMORY_LIMIT_METRIC,
            new String[]{"area"},
            new String[]{"nonheap"}),
        .0000001);
  } 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Test
  public void testMemoryAreas() {
    assertEquals(
        500000L,
        registry.getSampleValue(
            "jvm_memory_bytes_used",
            new String[]{"area"},
            new String[]{"heap"}),
        .0000001);
    assertEquals(
        1000000L,
        registry.getSampleValue(
            "jvm_memory_bytes_committed",
            new String[]{"area"},
            new String[]{"heap"}),
        .0000001);
    assertEquals(
        2000000L,
        registry.getSampleValue(
            "jvm_memory_bytes_max",
            new String[]{"area"},
            new String[]{"heap"}),
        .0000001);
    assertEquals(
        10000L,
        registry.getSampleValue(
            "jvm_memory_bytes_used",
            new String[]{"area"},
            new String[]{"nonheap"}),
        .0000001);
    assertEquals(
        20000L,
        registry.getSampleValue(
            "jvm_memory_bytes_committed",
            new String[]{"area"},
            new String[]{"nonheap"}),
        .0000001);
    assertEquals(
        3000000L,
        registry.getSampleValue(
            "jvm_memory_bytes_max",
            new String[]{"area"},
            new String[]{"nonheap"}),
        .0000001);
  }