Пример #1
0
  @Test
  public void pollTest2() {
    MinimiKeko<Node> keko = new MinimiKeko(new Node[10]);
    Node maali = new Node(0, 0);
    for (int i = 0; i < 5; i++) {
      Node a = new Node(3, i);
      a.setfScore(maali);
      keko.add(a);
    }

    assertEquals(new Node(3, 0), keko.poll());
  }
Пример #2
0
  @Test
  public void addTest3() {
    MinimiKeko<Node> keko = new MinimiKeko(new Node[150]);
    Node maali = new Node(0, 0);
    for (int i = 3; i < 15; i++) {
      for (int j = 3; j < 15; j++) {
        Node a = new Node(i, j);
        a.setfScore(maali);
        keko.add(a);
      }
    }

    assertEquals(new Node(3, 3), keko.peek());
  }