public synchronized Integer get() {
    while (sourceList.isEmpty()) {
      try {
        LOGGER.info("waiting");
        wait();
      } catch (InterruptedException e) {
        LOGGER.error("Error occurred: ", e);
      }
    }
    LOGGER.info("getting");
    return sourceList.peek();
  }
@Test
  void testGet() {
    var g = new GuardedQueue();
    var executorService = Executors.newFixedThreadPool(2);
    executorService.submit(() -> value = g.get());
    executorService.submit(() -> g.put(10));
    executorService.shutdown();
    try {
      executorService.awaitTermination(30, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      LOGGER.error("Error occurred: ", e);
    }
    assertEquals(Integer.valueOf(10), value);
  }