### Question:
ThreadUtil { public static boolean isMainThread() { return Looper.myLooper() == Looper.getMainLooper(); }  static void setNeedDetectRunningThread(boolean sNeedDetect); static void setMainScheduler(Scheduler sMainScheduler); static void setComputationScheduler(Scheduler sComputationScheduler); static Scheduler mainScheduler(); static Scheduler computationScheduler(); static boolean isMainThread(); static void ensureMainThread(String tag); static void ensureMainThread(); static void ensureWorkThread(String tag); static void ensureWorkThread(); static @NonNull Handler createIfNotExistHandler(String tag); static @Nullable Handler obtainHandler(String tag); static void destoryHandler(String tag); static Executor sMain; }### Answer:
@Test public void isMainThread() { boolean isMainThread = ThreadUtil.isMainThread(); assertTrue(isMainThread); final boolean[] isMainThreadInThread = {true}; Thread thread = new Thread(new Runnable() { @Override public void run() { isMainThreadInThread[0] = ThreadUtil.isMainThread(); } }); thread.start(); try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } assertFalse(isMainThreadInThread[0]); }