44import com .alibaba .fastjson .JSONPath ;
55import com .google .common .collect .Lists ;
66import com .google .common .collect .Maps ;
7+ import com .zsx .demo .pojo .BBB ;
8+ import com .zsx .demo .pojo .CCC ;
9+ import com .zsx .demo .pojo .DDD ;
710import com .zsx .tool .GzipUtil ;
811import org .apache .commons .compress .compressors .gzip .GzipUtils ;
912import org .apache .commons .lang3 .RandomStringUtils ;
2932public class UnitTest {
3033
3134
35+ @ Test
36+ void t11 () {
37+
38+ CCC ccc = new CCC ();
39+
40+ BBB bbb = new BBB ();
41+ bbb .setName ("zsx" );
42+ bbb .setAge ("23" );
43+ bbb .setContent ("content" );
44+
45+ ccc .setA (Lists .newArrayList (bbb ));
46+
47+
48+ System .out .println (JSON .toJSONString (ccc ));
49+
50+ DDD ddd = new DDD ();
51+ ddd .setB (ccc .getA ());
3252
33- @ Test void t11 (){
53+ System . out . println ( JSON . toJSONString ( ddd ));
3454
3555 }
3656
3757
38- @ Test void t10 (){
58+ @ Test
59+ void t10 () {
3960 StringBuilder str = new StringBuilder ();
4061 IntStream .range (1 , 1000 ).forEach (item -> str .append (item ));
4162 String string = str .toString ();
@@ -50,7 +71,8 @@ public class UnitTest {
5071 }
5172
5273
53- @ Test void t9 (){
74+ @ Test
75+ void t9 () {
5476 TreeMap <Comparable , @ Nullable Object > treeMap = Maps .newTreeMap ();
5577 treeMap .put ("A" , 1 );
5678 treeMap .put ("C" , 1 );
@@ -61,7 +83,9 @@ public class UnitTest {
6183 System .out .println (en .getKey ());
6284 }
6385 }
64- @ Test void t8 (){
86+
87+ @ Test
88+ void t8 () {
6589 ArrayList <String > list = new ArrayList <>();
6690 list .add ("1" );
6791
@@ -72,7 +96,8 @@ public class UnitTest {
7296
7397 }
7498
75- @ Test void t7 (){
99+ @ Test
100+ void t7 () {
76101 HashSet <String > set = new HashSet <>();
77102 for (int i = 0 ; i < 100 ; i ++) {
78103 set .add (RandomStringUtils .randomAlphanumeric (6 ));
@@ -82,10 +107,11 @@ public class UnitTest {
82107 set .forEach (System .out ::println );
83108 }
84109
85- @ Test void t6 (){
110+ @ Test
111+ void t6 () {
86112 String str = "009121,222,345678" ;
87113 System .out .println (str .lastIndexOf ("," ));
88- System .out .println (str .substring (10 + 1 ));
114+ System .out .println (str .substring (10 + 1 ));
89115 }
90116
91117 @ Test
0 commit comments