Use HashSet for test 2005

Test 2005 would sometimes fail due to all test threads filling up
their results array before suspension occurs. This can cause the test
to fail as it's an error to call SuspendThreadList without any
threads. To fix this we change the results list to a HashSet and no
longer have to worry about it filling up.

Test: ./test.py --host
Bug: 147407925
Change-Id: I8a5830e8f204993d674962ebb53092faacb651ed
diff --git a/test/2005-pause-all-redefine-multithreaded/src/art/Test2005.java b/test/2005-pause-all-redefine-multithreaded/src/art/Test2005.java
index e805a5f..6a5dac5 100644
--- a/test/2005-pause-all-redefine-multithreaded/src/art/Test2005.java
+++ b/test/2005-pause-all-redefine-multithreaded/src/art/Test2005.java
@@ -22,8 +22,6 @@
 public class Test2005 {
   private static final int NUM_THREADS = 20;
   private static final String DEFAULT_VAL = "DEFAULT_VALUE";
-  // Don't perform more than this many repeats per thread to prevent OOMEs
-  private static final int TASK_COUNT_LIMIT = 1000;
 
   public static final class Transform {
     public String greetingEnglish;
@@ -110,14 +108,14 @@
     public MyThread(CountDownLatch delay, int id) {
       super("Thread: " + id);
       this.thr_id = id;
-      this.results = new ArrayList<>(TASK_COUNT_LIMIT);
+      this.results = new HashSet<>();
       this.finish = false;
       this.delay = delay;
     }
 
     public void run() {
       delay.countDown();
-      while (!finish && results.size() < TASK_COUNT_LIMIT) {
+      while (!finish) {
         Transform t = new Transform();
         results.add(t.sayHi());
       }
@@ -140,7 +138,7 @@
       }
     }
 
-    public ArrayList<String> results;
+    public HashSet<String> results;
     public volatile boolean finish;
     public int thr_id;
     public CountDownLatch delay;