title: Concurrent Programming issue java
body: <p>So I am down to figuring out how to get the objects to keep track of how many diamonds they take with each iteration of the executor service</p>
  
  <pre><code>public class DwarfMine {
  
      public DwarfMine() {
      }
  
      public int diamonds = 100;
  
      public int getDiamonds() {
          return diamonds;
      }
  
      public synchronized int subtractDiamonds(int howMany) {
          diamonds -= howMany;
          System.out.println("There are now " + diamonds + " left in the mine!");
          return diamonds;
      }
  
  }
  </code></pre>