@Test
public void send_shouldNotUsePreviouslyFilledInLastIntentData() throws Exception {
Intent[] intents = {new Intent("first"), new Intent("second")};
Context context = Robolectric.setupActivity(Activity.class);
PendingIntent pendingIntent = PendingIntent.getActivities(context, 99, intents, 100);
Activity otherContext = Robolectric.setupActivity(Activity.class);
Intent firstFillIntent = new Intent();
firstFillIntent.putExtra("KEY1", 23);
firstFillIntent.putExtra("KEY2", 24);
pendingIntent.send(otherContext, 0, firstFillIntent);
ShadowActivity shadowActivity = shadowOf(otherContext);
shadowActivity.clearNextStartedActivities();
Intent secondFillIntent = new Intent();
secondFillIntent.putExtra("KEY1", 50);
pendingIntent.send(otherContext, 0, secondFillIntent);
Intent second = shadowActivity.getNextStartedActivity();
assertThat(second).isNotNull();
assertThat(second.filterEquals(intents[1])).isTrue();
assertThat(second.getIntExtra("KEY1", -1)).isEqualTo(50);
assertThat(second.hasExtra("KEY2")).isFalse();
}