@Test public void shouldReturnViewGroupWhenActivityIsNotNull(){ when(activity.findViewById(anyInt())).thenReturn(viewGroup); ViewGroup viewGroup = PermissionsUIViews.getAppContainer(activity); assertSame(this.viewGroup, viewGroup); verify(activity).findViewById(anyInt()); }
public static ViewGroup getAppContainer(Activity activity) throws NullContainerException { if (activity != null) { return (ViewGroup) activity.findViewById(android.R.id.content); } else { throw new NullContainerException("Container is null"); } }
PermissionsUIViews { public static ViewGroup getAppContainer(Activity activity) throws NullContainerException { if (activity != null) { return (ViewGroup) activity.findViewById(android.R.id.content); } else { throw new NullContainerException("Container is null"); } } }
PermissionsUIViews { public static ViewGroup getAppContainer(Activity activity) throws NullContainerException { if (activity != null) { return (ViewGroup) activity.findViewById(android.R.id.content); } else { throw new NullContainerException("Container is null"); } }  }
PermissionsUIViews { public static ViewGroup getAppContainer(Activity activity) throws NullContainerException { if (activity != null) { return (ViewGroup) activity.findViewById(android.R.id.content); } else { throw new NullContainerException("Container is null"); } }  @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) static void showRationaleView(final RationaleResponse rationaleResponse, Context context,
      int rationaleTitleStringId, int rationaleMessageStringId); static void showPermissionToast(Context context, int stringId); static ViewGroup getAppContainer(Activity activity); }
PermissionsUIViews { public static ViewGroup getAppContainer(Activity activity) throws NullContainerException { if (activity != null) { return (ViewGroup) activity.findViewById(android.R.id.content); } else { throw new NullContainerException("Container is null"); } }  @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) static void showRationaleView(final RationaleResponse rationaleResponse, Context context,
      int rationaleTitleStringId, int rationaleMessageStringId); static void showPermissionToast(Context context, int stringId); static ViewGroup getAppContainer(Activity activity);  }