SimpleIntent extends BaseIntent<SimpleIntent> { public SimpleIntent activityClass(@NonNull final Class<? extends Activity> activityClass) { this.activityClass = activityClass; this.type = TYPE_ACTIVITY; return this; }  SimpleIntent activityClass(@NonNull final Class<? extends Activity> activityClass); @Nullable Class<? extends Activity> activityClass(); SimpleIntent action(@NonNull final String action); @NonNull String action(); SimpleIntent flags(@IntRange(from = 0, to = Integer.MAX_VALUE) final int flags); SimpleIntent flag(@IntRange(from = 1, to = Integer.MAX_VALUE) final int flag); @IntRange(from = 0, to = Integer.MAX_VALUE) int flags(); SimpleIntent requestCode(final int requestCode); int requestCode();  }
@Test public void testActivityClass() { final SimpleIntent intent = new SimpleIntent(); intent.activityClass(TestActivity.class); assertEquals(TestActivity.class, intent.activityClass()); }
@SuppressWarnings("ConstantConditions") @Test public void testBuildWithActivityClass() { final SimpleIntent simpleIntent = new SimpleIntent(); simpleIntent.activityClass(TestActivity.class); final Intent intent = simpleIntent.build(context); assertThat(intent, is(notNullValue())); final ComponentName componentName = intent.getComponent(); assertThat(componentName, is(notNullValue())); assertThat(componentName.getClassName(), is(TestActivity.class.getName())); assertThat(componentName.getPackageName(), is(context.getPackageName())); }
@SuppressWarnings("ConstantConditions") @Test public void testBuildWithInvalidActivityClass() { final SimpleIntent intent = new SimpleIntent(); intent.activityClass(null); assertThatBuildThrowsExceptionWithMessage( context, intent, "No activity class specified." ); }