### Question:
PacmanEc2Utils { public static List<Volume> collectAllVolumes(AmazonEC2 ec2ServiceClient, DescribeVolumesRequest request) { DescribeVolumesResult result; String nextToken; List<Volume> volumes = new ArrayList<>(); do { result = ec2ServiceClient.describeVolumes(request); volumes.addAll(result.getVolumes()); nextToken = result.getNextToken(); request.setNextToken(nextToken); } while (null != nextToken); return volumes; } private  PacmanEc2Utils(); static List<Volume> collectAllVolumes(AmazonEC2 ec2ServiceClient,
            DescribeVolumesRequest request); static List<FlowLog> getFlowLogs(AmazonEC2 ec2ServiceClient,
            DescribeFlowLogsRequest describeFlowLogsRequest); static Filter setFilters(String filterName, String filterValue); static Map<String, Boolean> checkAccessibleToAll(
            Set<GroupIdentifier> secuityGroups, String portToCheck,
            String sgRulesUrl, String cidrIp);  }### Answer:
@SuppressWarnings("static-access") @Test public void collectAllVolumesTest() throws Exception { Volume vol = new Volume(); vol.setVolumeId("123"); Collection<Volume> volumes = new ArrayList<>(); volumes.add(vol); DescribeVolumesResult result = new DescribeVolumesResult(); result.setVolumes(volumes); when(ec2ServiceClient.describeVolumes(anyObject())).thenReturn(result); assertThat(pacmanEc2Utils.collectAllVolumes(ec2ServiceClient,describeVolumesRequest),is(notNullValue())); }