@Test
  public void callWithoutBackups() throws Exception {
    final int itemCount = 10000;
    final Map<Integer, Integer> map = hz.getMap("map");

    for (int i = 0; i < itemCount; i++) {
      map.put(i, i);
    }

    RestartThread restartThread = new RestartThread();
    restartThread.start();

    TestThread[] testThreads = new TestThread[THREAD_COUNT];
    for (int i = 0; i < testThreads.length; i++) {
      testThreads[i] =
          new TestThread("GetThread-" + i) {
            @Override
            void doRun() {
              long endTime =
                  System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(DURATION_SECONDS);

              Random random = new Random();
              while (true) {
                int key = random.nextInt(itemCount);
                assertEquals(new Integer(key), map.get(key));
                if (System.currentTimeMillis() > endTime) {
                  break;
                }
              }
            }
          };
      testThreads[i].start();
    }

    sleepSeconds(DURATION_SECONDS);

    for (TestThread thread : testThreads) {
      thread.join(TimeUnit.MINUTES.toMillis(1));
      thread.assertDiedPeacefully();
    }

    restartThread.stop = true;
  }
  @Test
  @Ignore(value = "https://github.com/hazelcast/hazelcast/issues/3683")
  public void callWithBackups() throws Exception {
    int itemCount = 10000;
    ConcurrentMap<Integer, Integer> map = hz.getMap("map");

    for (int i = 0; i < itemCount; i++) {
      map.put(i, 0);
    }

    RestartThread restartThread = new RestartThread();
    restartThread.start();

    UpdateThread[] testThreads = new UpdateThread[THREAD_COUNT];
    for (int i = 0; i < testThreads.length; i++) {
      testThreads[i] = new UpdateThread(i, itemCount, map);
      testThreads[i].start();
    }

    sleepSeconds(DURATION_SECONDS);

    for (TestThread thread : testThreads) {
      thread.join(TimeUnit.MINUTES.toMillis(1));
      thread.assertDiedPeacefully();
    }

    int[] expectedValues = new int[itemCount];
    for (UpdateThread t : testThreads) {
      for (int i = 0; i < itemCount; i++) {
        expectedValues[i] += t.values[i];
      }
    }

    for (int i = 0; i < itemCount; i++) {
      int expected = expectedValues[i];
      int found = map.get(i);
      assertEquals("value not the same", expected, found);
    }

    restartThread.stop = true;
  }