1
|
/**
|
2
|
* Copyright (C) 2016 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.hibernate;
|
10
|
|
11
|
import java.util.ArrayList;
|
12
|
|
13
|
import org.junit.Assert;
|
14
|
import org.junit.Test;
|
15
|
|
16
|
/**
|
17
|
* @author a.kohlbecker
|
18
|
* @date Jun 13, 2016
|
19
|
*
|
20
|
*/
|
21
|
public class HHH_9751_UtilTest extends Assert {
|
22
|
|
23
|
@Test
|
24
|
public void testNullRemoval() {
|
25
|
ArrayList<String> list = new ArrayList<String>();
|
26
|
list.add("1");
|
27
|
list.add("2");
|
28
|
list.add(null);
|
29
|
list.add(null);
|
30
|
list.add("3");
|
31
|
|
32
|
int removed = HHH_9751_Util.removeAllNull(list);
|
33
|
assertEquals(2, removed);
|
34
|
assertEquals(3, list.size());
|
35
|
assertNotNull(list.get(2));
|
36
|
}
|
37
|
|
38
|
}
|