title: Deleting value in a hashmap
body: <p>I have a hashmap that is populated already. I have abc123 mapped to 123.</p>
  
  <p>I first declare an object called test and give it a value of abc123</p>
  
  <p>I then check if my hashmap contains abc123.</p>
  
  <p>If it is true it will go into the if statement and get the mapping of the abc123 and put it into a string called value</p>
  
  <p>I then want to replace abc123 with just 123</p>
  
  <p>Now my hashmap key is 123 and my value is 123</p>
  
  <p>How would I get rid of the value of 123</p>
  
  <p>I want to be able to print out the mapping to 123 and get null</p>
  
  <pre><code>public void replace1(Map&lt;String, String&gt; barcodeMap) {
    Object test = "abc123";
  
    if (barcodeMap.containsKey(test)) {
  
       System.out.println("HERE I WILL PRINT THE MAPPING OF AGILENT         " + barcodeMap.get(test)); //output here is 123
  
       String value = barcodeMap.get(test);
  
       System.out.println("THE MAPPING OF VALUE SHOULD BE NULL     " + barcodeMap.get(value)); //output here is null
  
       barcodeMap.put(value, barcodeMap.remove(test));
  
       System.out.println("HERE I WILL PRINT THE MAPPING OF AGILENT it should be null:::::   " + barcodeMap.get(test)); //output here is null
  
       System.out.println("HERE IS THE MAPPING OF VALUE::::::::::::::       " + barcodeMap.get(value)); //output here is 123, i want it to be null here
  
    }
  </code></pre>
  
  <p>}</p>