Examples of ArrayListOfShorts


Examples of edu.umd.cloud9.util.array.ArrayListOfShorts

    assertEquals(6, a.get(3));
  }

  @Test
  public void testIntersection1() {
    ArrayListOfShorts a = new ArrayListOfShorts();
    a.add((short) 5);
    a.add((short) 3);
    a.add((short) 1);

    a.sort();

    ArrayListOfShorts b = new ArrayListOfShorts();
    b.add((short) 0);
    b.add((short) 1);
    b.add((short) 2);
    b.add((short) 3);

    ArrayListOfShorts c = a.intersection(b);

    assertEquals(1, c.get(0));
    assertEquals(3, c.get(1));
    assertEquals(2, c.size());
  }
View Full Code Here

Examples of edu.umd.cloud9.util.array.ArrayListOfShorts

    assertEquals(2, c.size());
  }

  @Test
  public void testIntersection2() {
    ArrayListOfShorts a = new ArrayListOfShorts();
    a.add((short) 5);

    ArrayListOfShorts b = new ArrayListOfShorts();
    b.add((short) 0);
    b.add((short) 1);
    b.add((short) 2);
    b.add((short) 3);

    ArrayListOfShorts c = a.intersection(b);
    assertTrue(c.size() == 0);
  }
View Full Code Here

Examples of edu.umd.cloud9.util.array.ArrayListOfShorts

    assertTrue(c.size() == 0);
  }

  @Test
  public void testIntersection3() {
    ArrayListOfShorts a = new ArrayListOfShorts();
    a.add((short) 3);
    a.add((short) 5);
    a.add((short) 7);
    a.add((short) 8);
    a.add((short) 9);

    ArrayListOfShorts b = new ArrayListOfShorts();
    b.add((short) 0);
    b.add((short) 1);
    b.add((short) 2);
    b.add((short) 3);

    ArrayListOfShorts c = a.intersection(b);

    assertEquals(3, c.get(0));
    assertEquals(1, c.size());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.