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