1 package com.androidplot.mock; 2 3 import android.os.Looper; 4 import mockit.Mock; 5 import mockit.MockClass; 6 7 8 /** 9 * myLooper and getMainLooper will always be equal. The implication is that any calling 10 * entity will assume that it is running on the main thread. Simulation of background mode 11 * is not supported. 12 */ 13 @MockClass(realClass = Looper.class) 14 public class MockLooper { 15 16 @Mock myLooper()17 public static Looper myLooper() { 18 return null; 19 } 20 21 @Mock getMainLooper()22 public static Looper getMainLooper() { 23 return null; 24 } 25 } 26