@Test public void checkIdDuplication() { final Set<Integer> usedIds = new HashSet<>(); for (final Tab.Type type : Tab.Type.values()) { final boolean added = usedIds.add(type.getTabId()); assertTrue("Id was already used: " + type.getTabId(), added); } }
public abstract int getTabId();
Tab { public abstract int getTabId(); }
Tab { public abstract int getTabId(); Tab();   Tab(@NonNull final JsonObject jsonObject); }
Tab { public abstract int getTabId(); Tab();   Tab(@NonNull final JsonObject jsonObject); @Nullable static Tab from(@NonNull final JsonObject jsonObject); @Nullable static Tab from(final int tabId); @Nullable static Type typeFrom(final int tabId); abstract int getTabId(); abstract String getTabName(Context context); @DrawableRes abstract int getTabIconRes(Context context); abstract Fragment getFragment(Context context); @Override boolean equals(final Object obj); void writeJsonOn(final JsonSink jsonSink); }
Tab { public abstract int getTabId(); Tab();   Tab(@NonNull final JsonObject jsonObject); @Nullable static Tab from(@NonNull final JsonObject jsonObject); @Nullable static Tab from(final int tabId); @Nullable static Type typeFrom(final int tabId); abstract int getTabId(); abstract String getTabName(Context context); @DrawableRes abstract int getTabIconRes(Context context); abstract Fragment getFragment(Context context); @Override boolean equals(final Object obj); void writeJsonOn(final JsonSink jsonSink);  }