title: Cannot find symbol - HashMap .replace() method
body: <p>I am practicing using HashMap in JAVA from a tutorial. 
  The sample HashMap implementation code fails to compile with the error:</p>
  
  <pre><code>DictionaryPractice.java:57: error: cannot find symbol
                                shoppingList.replace("Bread", Boolean.FALSE);
  symbol:   method replace(String,Boolean)
  location: variable shoppingList of type Map&lt;String,Boolean&gt;
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>import java.util.HashMap;
  import java.util.Map;
  
  public class DictionaryPractice {
      public static void main(String[] args) {
          Map&lt;String, Boolean&gt; shoppingList = new HashMap&lt;String, Boolean&gt;();
  
          // Put some stuff in dictionary
          shoppingList.put("Ham", true);
          shoppingList.put("Bread", Boolean.TRUE);
          shoppingList.put("Oreos", Boolean.TRUE);
          shoppingList.put("Eggs", Boolean.FALSE);
          shoppingList.put("Sugar", false);
  
          // Retrieve items
          System.out.println(shoppingList.get("Ham"));
          System.out.println(shoppingList.get("Oreos"));
  
          // Remove things
          shoppingList.remove("Eggs");
  
          // Replace values for a certain key
          shoppingList.replace("Bread", Boolean.FALSE);
      }
  }
  </code></pre>
  
  <p>I have read the JavaDocs on the HashMap class, and confirmed that <code>.replace</code> is a valid HashMap method to replace a value for a specified key. However, I keep getting the <code>cannot find symbol error</code>. Your kind help will be appreciated. Sorry for the basic question.<br>
  I am using jEdit Text Editor with the Compile plugin installed on a MacOSX Yosemite.</p>