Source:
<code>public void testGetPossibleAnnotationsForContainers_ListColumns(){ tableIndexDAO.deleteEntityData(Lists.newArrayList(2L,3L)); String annoKey = "myAnnotation"; EntityDTO file1 = createEntityDTO(2L, EntityType.file, 0); file1.setParentId(333L); <START> <END> AnnotationDTO annotationDTO1 = new AnnotationDTO(); annotationDTO1.setKey(annoKey); annotationDTO1.setType(AnnotationType.STRING); annotationDTO1.setEntityId(2L); annotationDTO1.setValue(Arrays.asList("123", "123456")); file1.setAnnotations(Collections.singletonList(annotationDTO1)); EntityDTO file2 = createEntityDTO(3L, EntityType.file, 0); file2.setParentId(222L); AnnotationDTO annotationDTO2 = new AnnotationDTO(); annotationDTO2.setKey(annoKey); annotationDTO2.setType(AnnotationType.STRING); annotationDTO2.setEntityId(3L); annotationDTO2.setValue(Arrays.asList("12", "1234")); file2.setAnnotations(Collections.singletonList(annotationDTO2)); tableIndexDAO.addEntityData(Lists.newArrayList(file1, file2)); Set<Long> containerIds = Sets.newHashSet(222L, 333L); long limit = 5; long offset = 0; List<ColumnModel> columns = tableIndexDAO.getPossibleColumnModelsForContainers(containerIds, ViewTypeMask.File.getMask(), limit, offset); assertNotNull(columns); assertEquals(1, columns.size()); ColumnModel cm = columns.get(0); assertEquals(annoKey, cm.getName()); assertEquals(ColumnType.STRING_LIST, cm.getColumnType()); assertEquals(6L, cm.getMaximumSize()); }</code><technical_language>annotation a list</technical_language>

Target:
public void testGetPossibleAnnotationsForContainers_ListColumns(){ tableIndexDAO.deleteEntityData(Lists.newArrayList(2L,3L)); String annoKey = "myAnnotation"; EntityDTO file1 = createEntityDTO(2L, EntityType.file, 0); file1.setParentId(333L); AnnotationDTO annotationDTO1 = new AnnotationDTO(); annotationDTO1.setKey(annoKey); annotationDTO1.setType(AnnotationType.STRING); annotationDTO1.setEntityId(2L); annotationDTO1.setValue(Arrays.asList("123")); file1.setAnnotations(Collections.singletonList(annotationDTO1)); EntityDTO file2 = createEntityDTO(3L, EntityType.file, 0); file2.setParentId(222L); AnnotationDTO annotationDTO2 = new AnnotationDTO(); annotationDTO2.setKey(annoKey); annotationDTO2.setType(AnnotationType.STRING); annotationDTO2.setEntityId(3L); annotationDTO2.setValue(Arrays.asList("12", "123456", "1234")); file2.setAnnotations(Collections.singletonList(annotationDTO2)); EntityDTO file3 = createEntityDTO(4L, EntityType.file, 0); file3.setParentId(222L); AnnotationDTO annotationDTO3 = new AnnotationDTO(); annotationDTO3.setKey(annoKey); annotationDTO3.setType(AnnotationType.STRING); annotationDTO3.setEntityId(3L); annotationDTO3.setValue(Arrays.asList("12345")); file3.setAnnotations(Collections.singletonList(annotationDTO3)); tableIndexDAO.addEntityData(Lists.newArrayList(file1, file2)); Set<Long> containerIds = Sets.newHashSet(222L, 333L); long limit = 5; long offset = 0; List<ColumnModel> columns = tableIndexDAO.getPossibleColumnModelsForContainers(containerIds, ViewTypeMask.File.getMask(), limit, offset); assertNotNull(columns); assertEquals(1, columns.size()); ColumnModel cm = columns.get(0); assertEquals(annoKey, cm.getName()); assertEquals(ColumnType.STRING_LIST, cm.getColumnType()); assertEquals(6L, cm.getMaximumSize()); }