< prev index next >

test/jdk/java/util/HashMap/ToArray.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 32,14 ***
--- 32,23 ---
  import java.util.Map;
  import java.util.stream.LongStream;
  
  /*
   * @test
+  * @bug 8336669
   * @summary HashMap.toArray() behavior tests
   * @author tvaleev
   */
  public class ToArray {
+     // An interned identity class holding an int (like non-Preview Integer)
+     record Int(int intValue) implements Comparable<Int> {
+         @Override
+         public int compareTo(Int o) {
+             return Integer.compare(intValue, o.intValue);
+         }
+     }
+ 
      public static void main(String[] args) {
          checkMap(false);
          checkMap(true);
          checkSet(false);
          checkSet(true);
< prev index next >