AuthUtils { @NonNull public static String scopeCollectionToString(@NonNull Collection<Scope> scopes) { Set<String> stringSet = scopeCollectionToStringSet(scopes); return TextUtils.join(" ", stringSet).toLowerCase(); }  static boolean isRedirectUriRegistered(@NonNull Activity activity, @NonNull Uri uri); @NonNull static String scopeCollectionToString(@NonNull Collection<Scope> scopes); static String customScopeCollectionToString(@NonNull Collection<String> scopes); static String mergeScopeStrings(String... scopes);  }
@Test public void scopeCollectionToString_withMultipleScopes_shouldReturnSpaceDelimitedStringScopes() { List<Scope> scopes = new ArrayList<Scope>(); scopes.add(Scope.PROFILE); scopes.add(Scope.HISTORY); String result = AuthUtils.scopeCollectionToString(scopes); assertEquals(result, "profile history"); }
@Test public void scopeCollectionToString_withOneScope_shouldReturnStringWithOneScope() { List<Scope> scopes = new ArrayList<Scope>(); scopes.add(Scope.HISTORY); String result = AuthUtils.scopeCollectionToString(scopes); assertEquals(result, "history"); }
@Test public void scopeCollectionToString_whenEmptyScopeCollection_shouldReturnEmptyString() { List<Scope> scopes = new ArrayList<Scope>(); String result = AuthUtils.scopeCollectionToString(scopes); assertTrue(result.isEmpty()); }