@Test public void testIsPublic() throws Exception { UrlDevice mockDevice = Mockito.mock(UrlDevice.class); Mockito.when(mockDevice.optExtraBoolean(PUBLIC_KEY, true)).thenReturn(true); Assert.assertTrue(Utils.isPublic(mockDevice)); Mockito.when(mockDevice.optExtraBoolean(PUBLIC_KEY, true)).thenReturn(false); Assert.assertFalse(Utils.isPublic(mockDevice)); }
public static boolean isPublic(UrlDevice urlDevice) { return urlDevice.optExtraBoolean(PUBLIC_KEY, true); }
Utils { public static boolean isPublic(UrlDevice urlDevice) { return urlDevice.optExtraBoolean(PUBLIC_KEY, true); } }
Utils { public static boolean isPublic(UrlDevice urlDevice) { return urlDevice.optExtraBoolean(PUBLIC_KEY, true); }  }
Utils { public static boolean isPublic(UrlDevice urlDevice) { return urlDevice.optExtraBoolean(PUBLIC_KEY, true); }  static void createBroadcastNotification(Context context,
      BroadcastReceiver stopServiceReceiver, int broadcastNotificationId, CharSequence title,
      CharSequence text, String filter); static byte[] getBytes(InputStream inputStream); static Set<String> getBlockedHosts(); static void hideAllMenuItems(Menu menu); static boolean isFavorite(String siteUrl); static void toggleFavorite(String siteUrl); static void saveFavorites(Context context); static void restoreFavorites(Context context); static boolean containsFavorite(List<PwPair> pairs); static boolean isBlocked(PwPair pwPair); static void addBlocked(PwPair pwPair); static void removeBlocked(String host); static void saveBlocked(Context context); static void restoreBlocked(Context context); static WifiDirectInfo parseWifiDirectName(String name); static boolean checkIfUserHasOptedIn(Context context); static void deleteCache(Context context); static void startScan(Context context); static String formatEndpointForSharedPrefernces(String pwsUrl, int pwsVersion,
                                                       String apiKey); static String getDefaultPwsEndpointPreferenceString(Context context); static void setOptInPreference(Context context); static void setPwsEndpointPreference(Context context, String endpoint); static void setSharedPreferencesDefaultValues(Context context); static boolean setPwsEndpoint(Context context, PwsClient pwsClient); static boolean setPwsEndpoint(Context context,
                                       PhysicalWebCollection physicalWebCollection); static void setPwsEndPointToGoogle(Context context, PwsClient pwsClient); static boolean isCurrentPwsSelectionValid(Context context); static boolean isGoogleApiKeyAvailable(Context context); static String getGoogleApiKey(Context context); static String getCustomPwsEndpoint(Context context); static boolean isFatBeaconEnabled(Context context); static boolean isMdnsEnabled(Context context); static boolean isWifiDirectEnabled(Context context); static boolean isDebugViewEnabled(Context context); static int getWifiDirectPort(Context context); static void warnUserOnMissingApiKey(Context context); static Intent createNavigateToUrlIntent(PwsResult pwsResult); static PendingIntent createNavigateToUrlPendingIntent(
      PwsResult pwsResult, Context context); static PwPair getTopRankedPwPairByGroupId(
      PhysicalWebCollection pwCollection, String groupId); static Bitmap getBitmapIcon(PhysicalWebCollection pwCollection, PwsResult pwsResult); static long getScanTimeMillis(UrlDevice urlDevice); static boolean isPublic(UrlDevice urlDevice); static boolean isResolvableDevice(UrlDevice urlDevice); static boolean isBleUrlDevice(UrlDevice urlDevice); static boolean isFatBeaconDevice(UrlDevice urlDevice); static boolean isMDNSPublicDevice(UrlDevice urlDevice); static boolean isMDNSLocalDevice(UrlDevice urlDevice); static boolean isWifiDirectDevice(UrlDevice urlDevice); static boolean isSSDPDevice(UrlDevice urlDevice); static int getRssi(UrlDevice urlDevice); static int getTxPower(UrlDevice urlDevice); static String getTitle(UrlDevice urlDevice); static String getDescription(UrlDevice urlDevice); static String getWifiAddress(UrlDevice urlDevice); static int getWifiPort(UrlDevice urlDevice); static long getPwsTripTimeMillis(PwsResult pwsResult); static String getGroupId(PwsResult pwsResult); static void updateRegion(UrlDevice urlDevice); static double getSmoothedRssi(UrlDevice urlDevice); static double getDistance(UrlDevice urlDevice); static String getRegionString(UrlDevice urlDevice); static boolean isGzippedFile(File file); static File gunzip(File src, File dest); }
Utils { public static boolean isPublic(UrlDevice urlDevice) { return urlDevice.optExtraBoolean(PUBLIC_KEY, true); }  static void createBroadcastNotification(Context context,
      BroadcastReceiver stopServiceReceiver, int broadcastNotificationId, CharSequence title,
      CharSequence text, String filter); static byte[] getBytes(InputStream inputStream); static Set<String> getBlockedHosts(); static void hideAllMenuItems(Menu menu); static boolean isFavorite(String siteUrl); static void toggleFavorite(String siteUrl); static void saveFavorites(Context context); static void restoreFavorites(Context context); static boolean containsFavorite(List<PwPair> pairs); static boolean isBlocked(PwPair pwPair); static void addBlocked(PwPair pwPair); static void removeBlocked(String host); static void saveBlocked(Context context); static void restoreBlocked(Context context); static WifiDirectInfo parseWifiDirectName(String name); static boolean checkIfUserHasOptedIn(Context context); static void deleteCache(Context context); static void startScan(Context context); static String formatEndpointForSharedPrefernces(String pwsUrl, int pwsVersion,
                                                       String apiKey); static String getDefaultPwsEndpointPreferenceString(Context context); static void setOptInPreference(Context context); static void setPwsEndpointPreference(Context context, String endpoint); static void setSharedPreferencesDefaultValues(Context context); static boolean setPwsEndpoint(Context context, PwsClient pwsClient); static boolean setPwsEndpoint(Context context,
                                       PhysicalWebCollection physicalWebCollection); static void setPwsEndPointToGoogle(Context context, PwsClient pwsClient); static boolean isCurrentPwsSelectionValid(Context context); static boolean isGoogleApiKeyAvailable(Context context); static String getGoogleApiKey(Context context); static String getCustomPwsEndpoint(Context context); static boolean isFatBeaconEnabled(Context context); static boolean isMdnsEnabled(Context context); static boolean isWifiDirectEnabled(Context context); static boolean isDebugViewEnabled(Context context); static int getWifiDirectPort(Context context); static void warnUserOnMissingApiKey(Context context); static Intent createNavigateToUrlIntent(PwsResult pwsResult); static PendingIntent createNavigateToUrlPendingIntent(
      PwsResult pwsResult, Context context); static PwPair getTopRankedPwPairByGroupId(
      PhysicalWebCollection pwCollection, String groupId); static Bitmap getBitmapIcon(PhysicalWebCollection pwCollection, PwsResult pwsResult); static long getScanTimeMillis(UrlDevice urlDevice); static boolean isPublic(UrlDevice urlDevice); static boolean isResolvableDevice(UrlDevice urlDevice); static boolean isBleUrlDevice(UrlDevice urlDevice); static boolean isFatBeaconDevice(UrlDevice urlDevice); static boolean isMDNSPublicDevice(UrlDevice urlDevice); static boolean isMDNSLocalDevice(UrlDevice urlDevice); static boolean isWifiDirectDevice(UrlDevice urlDevice); static boolean isSSDPDevice(UrlDevice urlDevice); static int getRssi(UrlDevice urlDevice); static int getTxPower(UrlDevice urlDevice); static String getTitle(UrlDevice urlDevice); static String getDescription(UrlDevice urlDevice); static String getWifiAddress(UrlDevice urlDevice); static int getWifiPort(UrlDevice urlDevice); static long getPwsTripTimeMillis(PwsResult pwsResult); static String getGroupId(PwsResult pwsResult); static void updateRegion(UrlDevice urlDevice); static double getSmoothedRssi(UrlDevice urlDevice); static double getDistance(UrlDevice urlDevice); static String getRegionString(UrlDevice urlDevice); static boolean isGzippedFile(File file); static File gunzip(File src, File dest); static final String PROD_ENDPOINT; static final int PROD_ENDPOINT_VERSION; static final String DEV_ENDPOINT; static final int DEV_ENDPOINT_VERSION; static final String GOOGLE_ENDPOINT; static final int GOOGLE_ENDPOINT_VERSION; static final String FAVORITES_KEY; static final String BLE_DEVICE_TYPE; static final String FAT_BEACON_DEVICE_TYPE; static final String MDNS_LOCAL_DEVICE_TYPE; static final String MDNS_PUBLIC_DEVICE_TYPE; static final String WIFI_DIRECT_DEVICE_TYPE; static final String SSDP_DEVICE_TYPE; }