Source:
static DocumentResultCollection<DetectLanguageResult> getExpectedBatchDetectedLanguages() { DetectedLanguage detectedLanguage1 = new DetectedLanguage().setName("English").setIso6391Name("en") .setScore(1.0); DetectedLanguage detectedLanguage2 = new DetectedLanguage().setName("Spanish").setIso6391Name("es") .setScore(1.0); DetectedLanguage detectedLanguage3 = new DetectedLanguage().setName("(Unknown)").setIso6391Name("(Unknown)") .setScore(0.0); List<DetectedLanguage> detectedLanguageList1 = new ArrayList<>(Collections.singletonList(detectedLanguage1)); List<DetectedLanguage> detectedLanguageList2 = new ArrayList<>(Collections.singletonList(detectedLanguage2)); List<DetectedLanguage> detectedLanguageList3 = new ArrayList<>(Collections.singletonList(detectedLanguage3)); TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics().setCharacterCount(26).setTransactionCount(1); TextDocumentStatistics textDocumentStatistics2 = new TextDocumentStatistics().setCharacterCount(39).setTransactionCount(1); TextDocumentStatistics textDocumentStatistics3 = new TextDocumentStatistics().setCharacterCount(6).setTransactionCount(1); DetectLanguageResult detectLanguageResult1 = new DetectLanguageResult("0", textDocumentStatistics1, detectedLanguage1, detectedLanguageList1); DetectLanguageResult detectLanguageResult2 = new DetectLanguageResult("1", textDocumentStatistics2, detectedLanguage2, detectedLanguageList2); DetectLanguageResult detectLanguageResult3 = new DetectLanguageResult("2", textDocumentStatistics3, detectedLanguage3, detectedLanguageList3); TextBatchStatistics textBatchStatistics = new TextBatchStatistics().setDocumentCount(3).setErroneousDocumentCount(0).setTransactionCount(3).setValidDocumentCount(3); List<DetectLanguageResult> detectLanguageResultList = new ArrayList<>(Arrays.asList(detectLanguageResult1, detectLanguageResult2, detectLanguageResult3)); return new DocumentResultCollection<>(detectLanguageResultList, "2019-10-01", textBatchStatistics); }

Target:
static DocumentResultCollection<DetectLanguageResult> getExpectedBatchDetectedLanguages() { DetectedLanguage detectedLanguage1 = new DetectedLanguage("English", "en", 1.0); DetectedLanguage detectedLanguage2 = new DetectedLanguage("Spanish", "es", 1.0); DetectedLanguage detectedLanguage3 = new DetectedLanguage("(Unknown)", "(Unknown)", 0.0); List<DetectedLanguage> detectedLanguageList1 = Collections.singletonList(detectedLanguage1); List<DetectedLanguage> detectedLanguageList2 = Collections.singletonList(detectedLanguage2); List<DetectedLanguage> detectedLanguageList3 = Collections.singletonList(detectedLanguage3); TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(26, 1); TextDocumentStatistics textDocumentStatistics2 = new TextDocumentStatistics(39, 1); TextDocumentStatistics textDocumentStatistics3 = new TextDocumentStatistics(6, 1); DetectLanguageResult detectLanguageResult1 = new DetectLanguageResult("0", textDocumentStatistics1, null, detectedLanguage1, detectedLanguageList1); DetectLanguageResult detectLanguageResult2 = new DetectLanguageResult("1", textDocumentStatistics2, null, detectedLanguage2, detectedLanguageList2); DetectLanguageResult detectLanguageResult3 = new DetectLanguageResult("2", textDocumentStatistics3, null, detectedLanguage3, detectedLanguageList3); TextDocumentBatchStatistics textDocumentBatchStatistics = new TextDocumentBatchStatistics(3, 0, 3, 3); List<DetectLanguageResult> detectLanguageResultList = Arrays.asList(detectLanguageResult1, detectLanguageResult2, detectLanguageResult3); return new DocumentResultCollection<>(detectLanguageResultList, MODEL_VERSION, textDocumentBatchStatistics); }