Skip to content

Commit c4aed22

Browse files
committed
Use Collections.emptyList() to compare empty lists
1 parent 347b577 commit c4aed22

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.jabref.logic.pdf;
22

33
import java.nio.file.Paths;
4+
import java.util.Collections;
45
import java.util.List;
56

67
import org.jabref.model.pdf.FileAnnotation;
@@ -19,13 +20,13 @@ public class PdfAnnotationImporterTest {
1920
public void noAnnotationsWriteProtected() {
2021

2122
List<FileAnnotation> annotations = importer.importAnnotations(Paths.get("src/test/resources/pdfs/write-protected.pdf"));
22-
assertEquals(0, annotations.size());
23+
assertEquals(Collections.emptyList(), annotations);
2324
}
2425

2526
@Test
2627
public void noAnnotationsEncrypted() {
2728
List<FileAnnotation> annotations = importer.importAnnotations(Paths.get("src/test/resources/pdfs/encrypted.pdf"));
28-
assertEquals(0, annotations.size());
29+
assertEquals(Collections.emptyList(), annotations);
2930
}
3031

3132
@Test
@@ -38,7 +39,7 @@ public void twoAnnotationsThesisExample() {
3839
@Test
3940
public void noAnnotationsMinimal() {
4041
List<FileAnnotation> annotations = importer.importAnnotations(Paths.get("src/test/resources/pdfs/minimal.pdf"));
41-
assertEquals(0, annotations.size());
42+
assertEquals(Collections.emptyList(), annotations);
4243
}
4344

4445
@Test
@@ -86,6 +87,7 @@ public void highlightNoNoteMinimal() {
8687
@Test
8788
public void highlightWithNoteMinimal() {
8889
List<FileAnnotation> annotations = importer.importAnnotations(Paths.get("src/test/resources/pdfs/minimal-highlight-with-note.pdf"));
90+
8991
assertEquals(1, annotations.size());
9092

9193
FileAnnotation note = annotations.get(0);
@@ -99,6 +101,7 @@ public void highlightWithNoteMinimal() {
99101
assertEquals("Linus Dietz", note.getLinkedFileAnnotation().getAuthor());
100102
}
101103

104+
102105
@Test
103106
public void underlineWithNoteMinimal() {
104107
List<FileAnnotation> annotations = importer.importAnnotations(Paths.get("src/test/resources/pdfs/minimal-underline.pdf"));

0 commit comments

Comments
 (0)