@Test public void translateFromListResponse_withTypes() { List<TypeSummary> typeSummaries = new ArrayList<>(); typeSummaries.add(TypeSummary.builder().typeArn("Type1").build()); typeSummaries.add(TypeSummary.builder().typeArn("Type2").build()); ListTypesResponse response = ListTypesResponse.builder() .typeSummaries(typeSummaries) .build(); List<ResourceModel> model = Translator.translateFromListResponse(response); assertThat(model.size()).isEqualTo(2); assertThat(model.get(0).getArn()).isEqualTo("Type1"); assertThat(model.get(1).getArn()).isEqualTo("Type2"); }
static List<ResourceModel> translateFromListResponse(@NonNull final ListTypesResponse awsResponse) { return streamOfOrEmpty(awsResponse.typeSummaries()) .map(typeSummary -> ResourceModel.builder() .arn(typeSummary.typeArn()) .build()) .collect(Collectors.toList()); }
Translator { static List<ResourceModel> translateFromListResponse(@NonNull final ListTypesResponse awsResponse) { return streamOfOrEmpty(awsResponse.typeSummaries()) .map(typeSummary -> ResourceModel.builder() .arn(typeSummary.typeArn()) .build()) .collect(Collectors.toList()); } }
Translator { static List<ResourceModel> translateFromListResponse(@NonNull final ListTypesResponse awsResponse) { return streamOfOrEmpty(awsResponse.typeSummaries()) .map(typeSummary -> ResourceModel.builder() .arn(typeSummary.typeArn()) .build()) .collect(Collectors.toList()); }  }
Translator { static List<ResourceModel> translateFromListResponse(@NonNull final ListTypesResponse awsResponse) { return streamOfOrEmpty(awsResponse.typeSummaries()) .map(typeSummary -> ResourceModel.builder() .arn(typeSummary.typeArn()) .build()) .collect(Collectors.toList()); }   }
Translator { static List<ResourceModel> translateFromListResponse(@NonNull final ListTypesResponse awsResponse) { return streamOfOrEmpty(awsResponse.typeSummaries()) .map(typeSummary -> ResourceModel.builder() .arn(typeSummary.typeArn()) .build()) .collect(Collectors.toList()); }    }