Utils { public static boolean isNewInstall(int baseCode) { return baseCode == VersionHistory.NEW_INSTALL_CODE; } private  Utils(); static int getCurrentVersionCode(Context context); static SharedPreferences getDefaultSharedPreferences(Context context, String prefName); static List<Method> getAnnotatedMethods(Class<?> clazz, Class<? extends Annotation> ann); static boolean hasAnnotatedMethods(Class<?> clazz, Class<? extends Annotation> ann); static void dispatch(VersionModule module, Method method); static boolean containsValueInRange(int[] values, int min, int max); static boolean isNewInstall(int baseCode); static final String TAG; }
@Test public void isNewInstall() throws Exception { assertTrue(Utils.isNewInstall(VersionHistory.NEW_INSTALL_CODE)); assertFalse(Utils.isNewInstall(1)); }