< prev index next >

test/java/util/Collections/CheckedListBash.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug     4904067
  27  * @summary Unit test for Collections.checkedList
  28  * @author  Josh Bloch

  29  */
  30 
  31 import java.util.*;
  32 
  33 public class CheckedListBash {
  34     static Random rnd = new Random();
  35 
  36     public static void main(String[] args) {
  37         int numItr = 100;
  38         int listSize = 100;
  39 
  40         for (int i=0; i<numItr; i++) {
  41             List s1 = newList();
  42             AddRandoms(s1, listSize);
  43 
  44             List s2 = newList();
  45             AddRandoms(s2, listSize);
  46 
  47             List intersection = clone(s1); intersection.retainAll(s2);
  48             List diff1 = clone(s1); diff1.removeAll(s2);




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug     4904067
  27  * @summary Unit test for Collections.checkedList
  28  * @author  Josh Bloch
  29  * @key randomness
  30  */
  31 
  32 import java.util.*;
  33 
  34 public class CheckedListBash {
  35     static Random rnd = new Random();
  36 
  37     public static void main(String[] args) {
  38         int numItr = 100;
  39         int listSize = 100;
  40 
  41         for (int i=0; i<numItr; i++) {
  42             List s1 = newList();
  43             AddRandoms(s1, listSize);
  44 
  45             List s2 = newList();
  46             AddRandoms(s2, listSize);
  47 
  48             List intersection = clone(s1); intersection.retainAll(s2);
  49             List diff1 = clone(s1); diff1.removeAll(s2);


< prev index next >