UserIdContext { public static String getPrefixedUserId(String userId) { if (userId != null && !userId.contains(COMMON_SCHEMA_PREFIX_SEPARATOR)) { return CUSTOM_PREFIX + COMMON_SCHEMA_PREFIX_SEPARATOR + userId; } return userId; }  static synchronized UserIdContext getInstance(); @VisibleForTesting static synchronized void unsetInstance(); static boolean checkUserIdValidForOneCollector(String userId); static boolean checkUserIdValidForAppCenter(String userId); static String getPrefixedUserId(String userId); void addListener(@NonNull Listener listener); void removeListener(@NonNull Listener listener); synchronized String getUserId(); void setUserId(String userId); @VisibleForTesting
    static final int USER_ID_APP_CENTER_MAX_LENGTH; }
@SuppressWarnings("ConstantConditions") @Test public void prefixedInvalidUserId() { assertNull(UserIdContext.getPrefixedUserId(null)); assertEquals("c:alice", UserIdContext.getPrefixedUserId("alice")); assertEquals(":", UserIdContext.getPrefixedUserId(":")); }
@Test public void prefixedValidUserId() { assertEquals("c:alice", UserIdContext.getPrefixedUserId("c:alice")); }