Realm implements Serializable, Comparable<Realm> { public static Realm[] values() { synchronized (KNOWN_REALMS) { return KNOWN_REALMS.values().toArray(new Realm[0]); } } private  Realm(@NonNull String realmId, @NonNull String secondLevelDomain); int compareTo(Realm other); @Override // For backward compatibility maintain the enum toString behavior String toString(); static Realm[] values(); static Realm valueOf(@NonNull String name); static Realm register(@NonNull String realmId, @NonNull String secondLevelDomain); static final Realm OC1; static final Realm OC2; static final Realm OC3; static final Realm OC4; static final Realm OC8; }
@Test public void noDuplicateRealmId() { final Set<String> realmIds = new HashSet<>(); for (Realm realm : Realm.values()) { assertFalse(realmIds.contains(realm.getRealmId())); realmIds.add(realm.getRealmId()); } }