Exemplo n.º 1
0
  public void testSimpleGetTime() {
    List<Long> times = new ArrayList<>(20);
    for (int i = 0; i < 20; i++) times.add(time_service.timestamp());

    System.out.println("times=" + times);

    Set<Long> set = new HashSet<>(times);
    System.out.println("set = " + set);

    assert set.size() < times.size();
    assert times.size() <= 20;

    set.clear();
    time_service.stop().interval(50).start();
    for (int i = 0; i < 20; i++) {
      set.add(time_service.timestamp());
      Util.sleep(200);
    }

    System.out.println("set=" + set);

    assert set.size() >= 15;
  }