IntentBuilder { public IntentBuilder flag(int flag) { return flags(flag); } IntentBuilder();  IntentBuilder(Intent intent);  IntentBuilder(String action);  IntentBuilder(String action, Uri uri);  IntentBuilder(Context packageContext, Class<?> cls);  IntentBuilder(String action, Uri uri, Context packageContext, Class<?> cls); IntentBuilder context(Context context); IntentBuilder action(String action); IntentBuilder service(Class<? extends Service> service); IntentBuilder activity(Class<? extends Activity> activity); IntentBuilder receiver(Class<? extends BroadcastReceiver> receiver); IntentBuilder component(ComponentName component); IntentBuilder className(Context packageCtx, String className); IntentBuilder className(String packageName, String className); IntentBuilder setPackage(String pack); IntentBuilder flag(int flag); IntentBuilder flags(int... flags); IntentBuilder categories(String... categories); IntentBuilder extras(Bundle extras); IntentBuilder extras(Intent intent); IntentBuilder data(Uri data); @TargetApi(Build.VERSION_CODES.JELLY_BEAN) IntentBuilder dataNormalize(Uri data); IntentBuilder type(String type); @TargetApi(Build.VERSION_CODES.JELLY_BEAN) IntentBuilder typeNormalize(String type); IntentBuilder extra(String name, boolean value); IntentBuilder extra(String name, byte value); IntentBuilder extra(String name, char value); IntentBuilder extra(String name, double value); IntentBuilder extra(String name, float value); IntentBuilder extra(String name, int value); IntentBuilder extra(String name, long value); IntentBuilder extra(String name, short value); IntentBuilder extra(String name, String value); IntentBuilder extra(String name, byte[] value); IntentBuilder extra(String name, boolean[] value); IntentBuilder extra(String name, char[] value); IntentBuilder extra(String name, double[] value); IntentBuilder extra(String name, float[] value); IntentBuilder extra(String name, int[] value); IntentBuilder extra(String name, long[] value); IntentBuilder extra(String name, short[] value); IntentBuilder extra(String name, Bundle value); IntentBuilder extra(String name, CharSequence value); IntentBuilder extra(String name, Parcelable value); IntentBuilder extra(String name, Serializable value); IntentBuilder extra(String name, CharSequence[] value); IntentBuilder extra(String name, Parcelable[] value); IntentBuilder extra(String name, String[] value); IntentBuilder extraCharSequenceList(String name, ArrayList<CharSequence> value); IntentBuilder extraIntegerList(String name, ArrayList<Integer> value); IntentBuilder extraParcelableList(String name, ArrayList<? extends Parcelable> value); IntentBuilder extraStringList(String name, ArrayList<String> value); Intent build();  }
@Test public void flagOne() { Intent mock = mock(Intent.class); new IntentBuilder(mock).flag(Intent.FLAG_ACTIVITY_CLEAR_TASK); verify(mock, times(1)).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); }