MPUtility { static String getBuildUUID(String versionCode) { if (versionCode == null) { versionCode = DeviceAttributes.UNKNOWN; } try { return UUID.nameUUIDFromBytes(versionCode.getBytes()).toString(); }catch (AssertionError e) { return DeviceAttributes.UNKNOWN; } }  static long getAvailableMemory(Context context); static boolean isSystemMemoryLow(Context context); static long getSystemMemoryThreshold(Context context); static long getRemainingHeapInBytes(); static boolean isEmpty(CharSequence str); static boolean isEmpty(JSONArray jsonArray); static boolean isEmpty(JSONObject jsonObject); static boolean isEmpty(Map map); static boolean isEmpty(Collection collection); @WorkerThread @TargetApi(Build.VERSION_CODES.ECLAIR) static AdIdInfo getAdIdInfo(Context context); static boolean isInDaylightSavings(); static boolean isEqual(Object field, Object field1); static String getGpsEnabled(Context context); @SuppressLint("MissingPermission") static Integer getNetworkType(Context context, TelephonyManager telephonyManager); static long getAvailableInternalDisk(Context context); static long getAvailableExternalDisk(Context context); static String getAppVersionName(Context context); static String hmacSha256Encode(String key, String data); static JSONObject getJsonResponse(MPConnection connection); static JSONObject getJsonResponse(HttpURLConnection connection); static JSONObject getJsonResponse(InputStream is); static long getDiskSpace(Context context, File path); static String getErrorMessage(HttpURLConnection connection); static long millitime(); @TargetApi(Build.VERSION_CODES.CUPCAKE) static String getAndroidID(Context context); static String getTimeZone(); static int getOrientation(Context context); static long getTotalMemory(Context context); @TargetApi(Build.VERSION_CODES.JELLY_BEAN) static long getTotalMemoryJB(Context context); static long getTotalMemoryPreJB(); static String getOpenUDID(Context context); static String getRampUdid(Context context); static boolean isTablet(Context context); static boolean hasNfc(Context context); static String getBluetoothVersion(Context context); static boolean isPhoneRooted(); static int mpHash(String input); static boolean hasTelephony(Context context); @SuppressLint("MissingPermission") static boolean isBluetoothEnabled(Context context); static boolean checkPermission(Context context, String permission); static boolean isGmsAdIdAvailable(); static boolean isSupportLibAvailable(); static Boolean isFirebaseAvailable(); static boolean isInstallRefApiAvailable(); static BigInteger hashFnv1A(byte[] data); static boolean isServiceAvailable(Context context, Class<?> service); static JSONObject wrapExtras(Bundle extras); static JSONObject mapToJson(Map<String, String> map); static boolean isAppDebuggable(Context context); static boolean isDevEnv(); static JSONObject enforceAttributeConstraints(Map<String, String> attributes); static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute); static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, Boolean caseInsensitive, boolean increment, boolean userAttribute); static String findCaseInsensitiveKey(JSONObject jsonObject, String key); static boolean isInstantApp(final Context context); static boolean containsNullKey(Map map); @Nullable static String getProp(String key);  }
@Test public void testGetBuildUUID() { UUID.fromString(MPUtility.getBuildUUID(null)); assertTrue("UUIDs should have been the same", MPUtility.getBuildUUID("12345678").equals(MPUtility.getBuildUUID("12345678"))); assertFalse("UUIDs should have been different", MPUtility.getBuildUUID("1234567").equals(MPUtility.getBuildUUID("12345678"))); }