@Test public void toTestData() { FlashcardResponseModel.FlashcardModel flashcard = new FlashcardResponseModel.FlashcardModel(); flashcard.id = "id"; flashcard.word = "word"; flashcard.translation = "translation"; model.flashcardData = Collections.singletonList(flashcard); model.uiLanguage = "ui"; model.learningLanguage = "learn"; FlashcardTestData testData = model.toTestData(); assertThat(testData.getUiLanguage(), equalTo("ui")); assertThat(testData.getLearningLanguage(), equalTo("learn")); FlashcardWord word = testData.getWords().get(0); assertThat(word.getWord(), equalTo("word")); assertThat(word.getTranslation(), equalTo("translation")); assertThat(word.getId(), equalTo("id")); }
public FlashcardTestData toTestData() { List<FlashcardWord> words = Stream.of(flashcardData) .map(FlashcardModel::toWord) .collect(toList()); return FlashcardTestData.create(uiLanguage, learningLanguage, words); }
FlashcardResponseModel { public FlashcardTestData toTestData() { List<FlashcardWord> words = Stream.of(flashcardData) .map(FlashcardModel::toWord) .collect(toList()); return FlashcardTestData.create(uiLanguage, learningLanguage, words); } }
FlashcardResponseModel { public FlashcardTestData toTestData() { List<FlashcardWord> words = Stream.of(flashcardData) .map(FlashcardModel::toWord) .collect(toList()); return FlashcardTestData.create(uiLanguage, learningLanguage, words); }  }
FlashcardResponseModel { public FlashcardTestData toTestData() { List<FlashcardWord> words = Stream.of(flashcardData) .map(FlashcardModel::toWord) .collect(toList()); return FlashcardTestData.create(uiLanguage, learningLanguage, words); }  FlashcardTestData toTestData(); }
FlashcardResponseModel { public FlashcardTestData toTestData() { List<FlashcardWord> words = Stream.of(flashcardData) .map(FlashcardModel::toWord) .collect(toList()); return FlashcardTestData.create(uiLanguage, learningLanguage, words); }  FlashcardTestData toTestData();  }