diff --git a/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java b/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
new file mode 100644
index 0000000..1e6737d
--- /dev/null
+++ b/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.launcher3.celllayout;
+
+import android.view.View;
+
+import com.android.launcher3.CellLayout;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.views.DoubleShadowBubbleTextView;
+
+import java.util.ArrayList;
+
+public class CellLayoutTestUtils {
+
+    public static ArrayList<CellLayoutBoard> workspaceToBoards(Launcher launcher) {
+        ArrayList<CellLayoutBoard> boards = new ArrayList<>();
+        int widgetCount = 0;
+        for (CellLayout cellLayout : launcher.getWorkspace().mWorkspaceScreens) {
+            CellLayoutBoard board = new CellLayoutBoard();
+            int count = cellLayout.getShortcutsAndWidgets().getChildCount();
+            for (int i = 0; i < count; i++) {
+                View callView = cellLayout.getShortcutsAndWidgets().getChildAt(i);
+                CellLayoutLayoutParams params =
+                        (CellLayoutLayoutParams) callView.getLayoutParams();
+                // is icon
+                if (callView instanceof DoubleShadowBubbleTextView) {
+                    board.addIcon(params.getCellX(), params.getCellY());
+                } else {
+                    // is widget
+                    board.addWidget(params.getCellX(), params.getCellY(), params.cellHSpan,
+                            params.cellVSpan, (char) ('A' + widgetCount));
+                    widgetCount++;
+                }
+            }
+            boards.add(board);
+        }
+        return boards;
+    }
+}
diff --git a/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java b/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java
index 35f6cbc..3443fd9 100644
--- a/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java
+++ b/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java
@@ -20,12 +20,10 @@
 
 import android.graphics.Point;
 import android.util.Log;
-import android.view.View;
 
 import androidx.test.ext.junit.runners.AndroidJUnit4;
 import androidx.test.filters.SmallTest;
 
-import com.android.launcher3.CellLayout;
 import com.android.launcher3.InvariantDeviceProfile;
 import com.android.launcher3.celllayout.testcases.FullReorderCase;
 import com.android.launcher3.celllayout.testcases.MoveOutReorderCase;
@@ -38,7 +36,6 @@
 import com.android.launcher3.ui.AbstractLauncherUiTest;
 import com.android.launcher3.ui.TaplTestsLauncher3;
 import com.android.launcher3.util.rule.ShellCommandRule;
-import com.android.launcher3.views.DoubleShadowBubbleTextView;
 
 import org.junit.Assume;
 import org.junit.Before;
@@ -105,30 +102,7 @@
     }
 
     private ArrayList<CellLayoutBoard> workspaceToBoards() {
-        return getFromLauncher(l -> {
-            ArrayList<CellLayoutBoard> boards = new ArrayList<>();
-            int widgetCount = 0;
-            for (CellLayout cellLayout : l.getWorkspace().mWorkspaceScreens) {
-                CellLayoutBoard board = new CellLayoutBoard();
-                int count = cellLayout.getShortcutsAndWidgets().getChildCount();
-                for (int i = 0; i < count; i++) {
-                    View callView = cellLayout.getShortcutsAndWidgets().getChildAt(i);
-                    CellLayoutLayoutParams params =
-                            (CellLayoutLayoutParams) callView.getLayoutParams();
-                    // is icon
-                    if (callView instanceof DoubleShadowBubbleTextView) {
-                        board.addIcon(params.getCellX(), params.getCellY());
-                    } else {
-                        // is widget
-                        board.addWidget(params.getCellX(), params.getCellY(), params.cellHSpan,
-                                params.cellVSpan, (char) ('A' + widgetCount));
-                        widgetCount++;
-                    }
-                }
-                boards.add(board);
-            }
-            return boards;
-        });
+        return getFromLauncher(CellLayoutTestUtils::workspaceToBoards);
     }
 
     private void runTestCase(ReorderTestCase testCase)
diff --git a/tests/src/com/android/launcher3/celllayout/testcases/ReorderTestCase.java b/tests/src/com/android/launcher3/celllayout/testcases/ReorderTestCase.java
index 1689e47..98fc20c 100644
--- a/tests/src/com/android/launcher3/celllayout/testcases/ReorderTestCase.java
+++ b/tests/src/com/android/launcher3/celllayout/testcases/ReorderTestCase.java
@@ -28,13 +28,14 @@
     public Point moveMainTo;
     public List<List<CellLayoutBoard>> mEnd;
 
-    ReorderTestCase(List<CellLayoutBoard> start, Point moveMainTo, List<CellLayoutBoard> ... end) {
+    public ReorderTestCase(List<CellLayoutBoard> start, Point moveMainTo,
+            List<CellLayoutBoard>... end) {
         mStart = start;
         this.moveMainTo = moveMainTo;
         mEnd = Arrays.asList(end);
     }
 
-    ReorderTestCase(String start, Point moveMainTo, String ... end) {
+    public ReorderTestCase(String start, Point moveMainTo, String ... end) {
         mStart = CellLayoutBoard.boardListFromString(start);
         this.moveMainTo = moveMainTo;
         mEnd = Arrays
