### Question:
IAMUtils { public static List<AccessKeyMetadata> getAccessKeyInformationForUser( final String userName, AmazonIdentityManagementClient iamClient) { ListAccessKeysRequest accessKeysRequest = new ListAccessKeysRequest(); accessKeysRequest.setUserName(userName); logger.debug("userName {} ",userName); List<AccessKeyMetadata> accessKeyMetadatas = new ArrayList<>(); ListAccessKeysResult keysResult = null; do { keysResult = iamClient.listAccessKeys(accessKeysRequest); accessKeyMetadatas.addAll(keysResult.getAccessKeyMetadata()); accessKeysRequest.setMarker(keysResult.getMarker()); } while (keysResult.isTruncated()); return accessKeyMetadatas; } private  IAMUtils(); static List<AccessKeyMetadata> getAccessKeyInformationForUser(
            final String userName, AmazonIdentityManagementClient iamClient); static Set<String> getAllowedActionsByUserPolicy(AmazonIdentityManagementClient iamClient, String userName); static List<AttachedPolicy> getAttachedPolicyOfIAMUser(String userName,
			AmazonIdentityManagementClient iamClient); static Set<String> getAllowedActionsByRolePolicy(AmazonIdentityManagementClient iamClient, String roleName); static List<AttachedPolicy> getAttachedPolicyOfIAMRole(final String roleName,
			AmazonIdentityManagementClient iamClient);  }### Answer:
@SuppressWarnings("static-access") @Test public void getAccessKeyInformationForUserTest() throws Exception { ListAccessKeysResult keysResult = new ListAccessKeysResult(); keysResult.setIsTruncated(false); when(iamClient.listAccessKeys(anyObject())).thenReturn(keysResult); assertThat(iamUtils.getAccessKeyInformationForUser("user",iamClient),is(notNullValue())); }