@Test public void testInstantiationFromParcelWithoutSuperState() { final Parcel parcel = Parcel.obtain(); parcel.writeParcelable(null, 0); parcel.setDataPosition(0); final AdapterSavedState savedState = new AdapterSavedState(parcel) {}; assertThat(savedState.getSuperState(), Matchers.<Parcelable>is(AdapterSavedState.EMPTY_STATE)); parcel.recycle(); }
@NonNull final public Parcelable getSuperState() { return superState == null ? EMPTY_STATE : superState; }
AdapterSavedState implements Parcelable { @NonNull final public Parcelable getSuperState() { return superState == null ? EMPTY_STATE : superState; } }
AdapterSavedState implements Parcelable { @NonNull final public Parcelable getSuperState() { return superState == null ? EMPTY_STATE : superState; } @SuppressWarnings("WeakerAccess")  AdapterSavedState(); protected  AdapterSavedState(@NonNull final Parcelable superState); protected  AdapterSavedState(@NonNull final Parcel source); }
AdapterSavedState implements Parcelable { @NonNull final public Parcelable getSuperState() { return superState == null ? EMPTY_STATE : superState; } @SuppressWarnings("WeakerAccess")  AdapterSavedState(); protected  AdapterSavedState(@NonNull final Parcelable superState); protected  AdapterSavedState(@NonNull final Parcel source); @Override void writeToParcel(@NonNull final Parcel dest, final int flags); @NonNull final Parcelable getSuperState(); @Override int describeContents(); }
AdapterSavedState implements Parcelable { @NonNull final public Parcelable getSuperState() { return superState == null ? EMPTY_STATE : superState; } @SuppressWarnings("WeakerAccess")  AdapterSavedState(); protected  AdapterSavedState(@NonNull final Parcelable superState); protected  AdapterSavedState(@NonNull final Parcel source); @Override void writeToParcel(@NonNull final Parcel dest, final int flags); @NonNull final Parcelable getSuperState(); @Override int describeContents(); static final AdapterSavedState EMPTY_STATE; static final Creator<AdapterSavedState> CREATOR; }