Code example for Account

0
        accounts = am.getAccountsByType("type_a");
        assertThat(accounts).isNotNull();
        assertThat(accounts.length).isEqualTo(1);
        assertThat(accounts[0]).isSameAs(a1);
 
        Account a3 = new Account("name_c", "type_a");
        Robolectric.shadowOf(am).addAccount(a3);
        accounts = am.getAccountsByType("type_a");
        assertThat(accounts).isNotNull();
        assertThat(accounts.length).isEqualTo(2);
        assertThat(accounts[0]).isSameAs(a1);
        assertThat(accounts[1]).isSameAs(a3);
    } 
 
}