KinClient { public KinAccount getAccount(int index) { return kinClientInternal.getAccount(index); } KinClient(@NonNull Context context, @NonNull Environment environment, String appId);  KinClient(@NonNull Context context, @NonNull Environment environment, @NonNull String appId, @NonNull String storeKey); @VisibleForTesting  KinClient(Environment environment, KeyStore keyStore, TransactionSender transactionSender,
              AccountInfoRetriever accountInfoRetriever, GeneralBlockchainInfoRetrieverImpl generalBlockchainInfoRetriever,
              BlockchainEventsCreator blockchainEventsCreator, BackupRestore backupRestore, String appId, String storeKey); @NonNull KinAccount addAccount(); @NonNull KinAccount importAccount(@NonNull String exportedJson, @NonNull String passphrase); KinAccount getAccount(int index); boolean hasAccount(); int getAccountCount(); boolean deleteAccount(int index); void clearAllAccounts(); Environment getEnvironment(); Request<Long> getMinimumFee(); long getMinimumFeeSync(); String getAppId(); String getStoreKey();  }
@Test public void getAccount_ExistingMultipleAccount() throws Exception { KeyPair account1 = createRandomAccount(); KeyPair account2 = createRandomAccount(); fakeKeyStore = new FakeKeyStore(Arrays.asList(account1, account2)); kinClient = createNewKinClient(); KinAccount expectedAccount2 = kinClient.getAccount(1); KinAccount expectedAccount1 = kinClient.getAccount(0); assertNotNull(expectedAccount1); assertNotNull(expectedAccount2); assertThat(account1.getAccountId(), equalTo(expectedAccount1.getPublicAddress())); assertThat(account2.getAccountId(), equalTo(expectedAccount2.getPublicAddress())); }
@Test public void getAccount_NegativeIndex() throws Exception { createKeyStoreWithRandomAccount(); assertNull(kinClient.getAccount(-1)); }
@Test public void getAccount_EmptyKeyStore_Null() throws Exception { KinAccount kinAccount = kinClient.getAccount(0); assertNull(kinAccount); }
@Test public void getAccount_ExistingAccount_SameAccount() throws Exception { KeyPair account = createKeyStoreWithRandomAccount(); KinAccount kinAccount = kinClient.getAccount(0); assertEquals(account.getAccountId(), kinAccount.getPublicAddress()); }