### Question:
Translator { static List<ResourceModel> translateFromListResponse(@NonNull final ListTypesResponse awsResponse) { return streamOfOrEmpty(awsResponse.typeSummaries()) .map(typeSummary -> ResourceModel.builder() .arn(typeSummary.typeArn()) .build()) .collect(Collectors.toList()); }    }### Answer:
@Test public void translateFromListResponse_nullResourceModel() { assertThatThrownBy(() -> Translator.translateFromListResponse(null)) .hasNoCause() .hasMessageStartingWith("awsResponse is marked") .isExactlyInstanceOf(NullPointerException.class); }
@Test public void translateFromListResponse_noTypes() { ListTypesResponse response = ListTypesResponse.builder().build(); List<ResourceModel> model = Translator.translateFromListResponse(response); assertThat(model.isEmpty()).isTrue(); }
@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"); }