@Test public void generateReport_empty() { when(documentClasses.count()).thenReturn(0L); List<ReportEntry> reportEntries = reportGenerator.generateReport(documentClasses); assertReportEntries(reportEntries, 0, 0, 0, 0, 0, 0); }
List<ReportEntry> generateReport(JavaRDD<DocumentToDocumentClasses> documentClasses) { Preconditions.checkNotNull(documentClasses); long classifiedDocumentCount = documentClasses.count(); if (classifiedDocumentCount == 0) { return createReportEntries(0, 0, 0, 0, 0, 0); } long arxivClassCount = documentClasses.map(docClass->size(docClass.getClasses().getArXivClasses())).reduce((i1, i2)-> i1+i2); long wosClassCount = documentClasses.map(docClass->size(docClass.getClasses().getWoSClasses())).reduce((i1, i2)-> i1+i2); long ddcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getDDCClasses())).reduce((i1, i2)-> i1+i2); long meshEuroPmcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getMeshEuroPMCClasses())).reduce((i1, i2)-> i1+i2); long acmClassCount = documentClasses.map(docClass->size(docClass.getClasses().getACMClasses())).reduce((i1, i2)-> i1+i2); return createReportEntries(classifiedDocumentCount, arxivClassCount, wosClassCount, ddcClassCount, meshEuroPmcClassCount, acmClassCount); }
DocClassificationReportGenerator { List<ReportEntry> generateReport(JavaRDD<DocumentToDocumentClasses> documentClasses) { Preconditions.checkNotNull(documentClasses); long classifiedDocumentCount = documentClasses.count(); if (classifiedDocumentCount == 0) { return createReportEntries(0, 0, 0, 0, 0, 0); } long arxivClassCount = documentClasses.map(docClass->size(docClass.getClasses().getArXivClasses())).reduce((i1, i2)-> i1+i2); long wosClassCount = documentClasses.map(docClass->size(docClass.getClasses().getWoSClasses())).reduce((i1, i2)-> i1+i2); long ddcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getDDCClasses())).reduce((i1, i2)-> i1+i2); long meshEuroPmcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getMeshEuroPMCClasses())).reduce((i1, i2)-> i1+i2); long acmClassCount = documentClasses.map(docClass->size(docClass.getClasses().getACMClasses())).reduce((i1, i2)-> i1+i2); return createReportEntries(classifiedDocumentCount, arxivClassCount, wosClassCount, ddcClassCount, meshEuroPmcClassCount, acmClassCount); } }
DocClassificationReportGenerator { List<ReportEntry> generateReport(JavaRDD<DocumentToDocumentClasses> documentClasses) { Preconditions.checkNotNull(documentClasses); long classifiedDocumentCount = documentClasses.count(); if (classifiedDocumentCount == 0) { return createReportEntries(0, 0, 0, 0, 0, 0); } long arxivClassCount = documentClasses.map(docClass->size(docClass.getClasses().getArXivClasses())).reduce((i1, i2)-> i1+i2); long wosClassCount = documentClasses.map(docClass->size(docClass.getClasses().getWoSClasses())).reduce((i1, i2)-> i1+i2); long ddcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getDDCClasses())).reduce((i1, i2)-> i1+i2); long meshEuroPmcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getMeshEuroPMCClasses())).reduce((i1, i2)-> i1+i2); long acmClassCount = documentClasses.map(docClass->size(docClass.getClasses().getACMClasses())).reduce((i1, i2)-> i1+i2); return createReportEntries(classifiedDocumentCount, arxivClassCount, wosClassCount, ddcClassCount, meshEuroPmcClassCount, acmClassCount); }  }
DocClassificationReportGenerator { List<ReportEntry> generateReport(JavaRDD<DocumentToDocumentClasses> documentClasses) { Preconditions.checkNotNull(documentClasses); long classifiedDocumentCount = documentClasses.count(); if (classifiedDocumentCount == 0) { return createReportEntries(0, 0, 0, 0, 0, 0); } long arxivClassCount = documentClasses.map(docClass->size(docClass.getClasses().getArXivClasses())).reduce((i1, i2)-> i1+i2); long wosClassCount = documentClasses.map(docClass->size(docClass.getClasses().getWoSClasses())).reduce((i1, i2)-> i1+i2); long ddcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getDDCClasses())).reduce((i1, i2)-> i1+i2); long meshEuroPmcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getMeshEuroPMCClasses())).reduce((i1, i2)-> i1+i2); long acmClassCount = documentClasses.map(docClass->size(docClass.getClasses().getACMClasses())).reduce((i1, i2)-> i1+i2); return createReportEntries(classifiedDocumentCount, arxivClassCount, wosClassCount, ddcClassCount, meshEuroPmcClassCount, acmClassCount); }   }
DocClassificationReportGenerator { List<ReportEntry> generateReport(JavaRDD<DocumentToDocumentClasses> documentClasses) { Preconditions.checkNotNull(documentClasses); long classifiedDocumentCount = documentClasses.count(); if (classifiedDocumentCount == 0) { return createReportEntries(0, 0, 0, 0, 0, 0); } long arxivClassCount = documentClasses.map(docClass->size(docClass.getClasses().getArXivClasses())).reduce((i1, i2)-> i1+i2); long wosClassCount = documentClasses.map(docClass->size(docClass.getClasses().getWoSClasses())).reduce((i1, i2)-> i1+i2); long ddcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getDDCClasses())).reduce((i1, i2)-> i1+i2); long meshEuroPmcClassCount = documentClasses.map(docClass->size(docClass.getClasses().getMeshEuroPMCClasses())).reduce((i1, i2)-> i1+i2); long acmClassCount = documentClasses.map(docClass->size(docClass.getClasses().getACMClasses())).reduce((i1, i2)-> i1+i2); return createReportEntries(classifiedDocumentCount, arxivClassCount, wosClassCount, ddcClassCount, meshEuroPmcClassCount, acmClassCount); }    }