/** {@inheritDoc} */
  @Override
  public Response createStock(Stock stock) {

    // assigns the stock id
    stock.setId(counter.incrementAndGet());
    // saves the stock
    stockMap.put(stock.getId(), stock);
    // creates response
    return Response.created(URI.create("/stocks/" + stock.getId())).build();
  }
  /** Creates new instance of {@link StockServiceResource} class. */
  public StockServiceResource() {

    // creates test stock
    Stock stock = new Stock();
    stock.setId(1L);
    stock.setName("Acme");
    stock.setCode("ACM");
    stock.setValue(new BigDecimal(37.5D));
    stock.setDate(new Date());

    stockMap.put(stock.getId(), stock);
  }