FragmentRequest { @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { final StringBuilder builder = new StringBuilder(128); builder.append("FragmentRequest{fragmentId: "); builder.append(fragmentId); builder.append(", outgoingFragmentId: "); builder.append(outgoingFragmentId); builder.append(", arguments: "); builder.append(arguments); builder.append(", transactionType: "); builder.append(transition); builder.append(", tag: "); builder.append(tag); builder.append(", viewContainerId: "); builder.append(viewContainerId); builder.append(", transition: "); builder.append(transition == null ? "null" : transition.getName()); builder.append(", transitionStyle: "); builder.append(transitionStyle); builder.append(", replaceSame: "); builder.append(hasFlag(REPLACE_SAME)); builder.append(", addToBackStack: "); builder.append(hasFlag(ADD_TO_BACK_STACK)); builder.append(", allowStateLoss: "); builder.append(hasFlag(ALLOW_STATE_LOSS)); builder.append(", immediate: "); builder.append(hasFlag(IMMEDIATE)); builder.append(", executed: "); builder.append(executed); return builder.append("}").toString(); } FragmentRequest(final FragmentController controller, int fragmentId);   FragmentRequest(final FragmentController controller, final Fragment fragment); @SuppressWarnings("StringBufferReplaceableByString") @Override String toString(); @NonNull Fragment fragment(); FragmentRequest fragmentId(final int fragmentId); int fragmentId(); FragmentRequest outgoingFragmentId(final int fragmentId); int outgoingFragmentId(); FragmentRequest arguments(@Nullable final Bundle arguments); @Nullable Bundle arguments(); FragmentRequest transaction(@Transaction final int transaction); @Transaction int transaction(); FragmentRequest tag(@Nullable final String fragmentTag); @Nullable String tag(); FragmentRequest viewContainerId(@IdRes final int containerId); @IdRes int viewContainerId(); FragmentRequest transition(@Nullable final FragmentTransition transition); @Nullable FragmentTransition transition(); FragmentRequest transitionStyle(@StyleRes final int transitionStyle); @StyleRes int transitionStyle(); FragmentRequest enterTransition(@Nullable final Object transition); @Nullable Object enterTransition(); FragmentRequest exitTransition(@Nullable final Object transition); @Nullable Object exitTransition(); FragmentRequest reenterTransition(@Nullable final Object transition); @Nullable Object reenterTransition(); FragmentRequest returnTransition(@Nullable final Object transition); @Nullable Object returnTransition(); FragmentRequest allowEnterTransitionOverlap(final boolean allowOverlap); Boolean allowEnterTransitionOverlap(); FragmentRequest allowReturnTransitionOverlap(final boolean allowOverlap); Boolean allowReturnTransitionOverlap(); @SafeVarargs final FragmentRequest sharedElements(@NonNull final Pair<View, String>... elements); FragmentRequest sharedElement(@NonNull final View element, @NonNull final String elementName); @Nullable List<Pair<View, String>> sharedElements(); @Nullable Pair<View, String> singleSharedElement(); FragmentRequest sharedElementEnterTransition(@Nullable final Object transition); @Nullable Object sharedElementEnterTransition(); FragmentRequest sharedElementReturnTransition(@Nullable final Object transition); @Nullable Object sharedElementReturnTransition(); FragmentRequest replaceSame(final boolean replace); boolean replaceSame(); FragmentRequest addToBackStack(final boolean add); boolean addToBackStack(); FragmentRequest allowStateLoss(final boolean allow); boolean allowStateLoss(); FragmentRequest immediate(final boolean immediate); boolean immediate(); @Nullable Fragment execute(); boolean executed(); static final int NO_ID; static final int NO_STYLE; static final int REPLACE; static final int ADD; static final int REMOVE; static final int SHOW; static final int HIDE; static final int ATTACH; static final int DETACH; }
@Test public void testToString() { final FragmentRequest request = new FragmentRequest(mock(FragmentController.class), FragmentRequest.NO_ID); final String toString = request.toString(); assertThat(toString.startsWith(FragmentRequest.class.getSimpleName()), is(true)); }