Code example for Intent

Methods: getExtras, getIntegerArrayListExtra, putIntegerArrayListExtra

0
        assertThat(Robolectric.shadowOf(intent.getExtras()).getStringArrayList("KEY")).isEqualTo(strings);
    } 
     
    @Test 
    public void putIntegerArrayListExtra_addsListToExtras() { 
        Intent intent = new Intent();
        final ArrayList<Integer> integers = new ArrayList<Integer>(Arrays.asList(100, 200, 300));
 
        intent.putIntegerArrayListExtra("KEY", integers);
        assertThat(intent.getIntegerArrayListExtra("KEY")).isEqualTo(integers);
        assertThat(Robolectric.shadowOf(intent.getExtras()).getIntegerArrayList("KEY")).isEqualTo(integers);
    } 
 
    private static class TestSerializable implements Serializable {
        private String someValue;
 
        public TestSerializable(String someValue) {
            this.someValue = someValue;
        } 
 
        @Override