@@ -61,24 +61,24 @@ public void testCreateArray() {
6161 public void testSetValue () throws ParseException , IOException {
6262 Map <String , Object > current = new LinkedHashMap <>();
6363 mapper .setValue (current , "testKey" , "testValue" );
64-
64+
6565 assertEquals (1 , current .size ());
6666 assertEquals ("testValue" , current .get ("testKey" ));
6767 }
6868
6969 @ Test
7070 public void testSetValueWithMultipleEntries () throws ParseException , IOException {
7171 LinkedHashMap <String , Object > current = new LinkedHashMap <>();
72-
72+
7373 mapper .setValue (current , "key1" , "value1" );
7474 mapper .setValue (current , "key2" , "value2" );
7575 mapper .setValue (current , "key3" , "value3" );
76-
76+
7777 assertEquals (3 , current .size ());
7878 assertEquals ("value1" , current .get ("key1" ));
7979 assertEquals ("value2" , current .get ("key2" ));
8080 assertEquals ("value3" , current .get ("key3" ));
81-
81+
8282 String [] keys = current .keySet ().toArray (new String [0 ]);
8383 assertEquals ("key1" , keys [0 ]);
8484 assertEquals ("key2" , keys [1 ]);
@@ -88,11 +88,11 @@ public void testSetValueWithMultipleEntries() throws ParseException, IOException
8888 @ Test
8989 public void testAddValue () throws ParseException , IOException {
9090 JSONArray current = new JSONArray ();
91-
91+
9292 mapper .addValue (current , "value1" );
9393 mapper .addValue (current , "value2" );
9494 mapper .addValue (current , 42 );
95-
95+
9696 assertEquals (3 , current .size ());
9797 assertEquals ("value1" , current .get (0 ));
9898 assertEquals ("value2" , current .get (1 ));
@@ -103,7 +103,7 @@ public void testAddValue() throws ParseException, IOException {
103103 public void testSetValueWithNullKey () throws ParseException , IOException {
104104 Map <String , Object > current = new LinkedHashMap <>();
105105 mapper .setValue (current , null , "testValue" );
106-
106+
107107 assertEquals (1 , current .size ());
108108 assertTrue (current .containsKey (null ));
109109 assertEquals ("testValue" , current .get (null ));
@@ -113,7 +113,7 @@ public void testSetValueWithNullKey() throws ParseException, IOException {
113113 public void testSetValueWithNullValue () throws ParseException , IOException {
114114 Map <String , Object > current = new LinkedHashMap <>();
115115 mapper .setValue (current , "testKey" , null );
116-
116+
117117 assertEquals (1 , current .size ());
118118 assertEquals (null , current .get ("testKey" ));
119119 }
@@ -122,23 +122,23 @@ public void testSetValueWithNullValue() throws ParseException, IOException {
122122 public void testAddValueWithNullValue () throws ParseException , IOException {
123123 JSONArray current = new JSONArray ();
124124 mapper .addValue (current , null );
125-
125+
126126 assertEquals (1 , current .size ());
127127 assertEquals (null , current .get (0 ));
128128 }
129129
130130 @ Test
131131 public void testOrderPreservation () throws ParseException , IOException {
132132 LinkedHashMap <String , Object > current = new LinkedHashMap <>();
133-
133+
134134 mapper .setValue (current , "first" , 1 );
135135 mapper .setValue (current , "second" , 2 );
136136 mapper .setValue (current , "third" , 3 );
137137 mapper .setValue (current , "fourth" , 4 );
138-
138+
139139 String [] expectedOrder = {"first" , "second" , "third" , "fourth" };
140140 String [] actualOrder = current .keySet ().toArray (new String [0 ]);
141-
141+
142142 for (int i = 0 ; i < expectedOrder .length ; i ++) {
143143 assertEquals (expectedOrder [i ], actualOrder [i ]);
144144 }
@@ -147,30 +147,30 @@ public void testOrderPreservation() throws ParseException, IOException {
147147 @ Test
148148 public void testComplexObjectStructure () throws ParseException , IOException {
149149 LinkedHashMap <String , Object > root = new LinkedHashMap <>();
150-
150+
151151 mapper .setValue (root , "name" , "test" );
152152 mapper .setValue (root , "age" , 25 );
153-
153+
154154 JSONArray array = new JSONArray ();
155155 mapper .addValue (array , "item1" );
156156 mapper .addValue (array , "item2" );
157157 mapper .setValue (root , "items" , array );
158-
158+
159159 LinkedHashMap <String , Object > nested = new LinkedHashMap <>();
160160 mapper .setValue (nested , "nestedKey" , "nestedValue" );
161161 mapper .setValue (root , "nested" , nested );
162-
162+
163163 assertEquals (4 , root .size ());
164164 assertEquals ("test" , root .get ("name" ));
165165 assertEquals (25 , root .get ("age" ));
166166 assertEquals (array , root .get ("items" ));
167167 assertEquals (nested , root .get ("nested" ));
168-
168+
169169 assertEquals (2 , array .size ());
170170 assertEquals ("item1" , array .get (0 ));
171171 assertEquals ("item2" , array .get (1 ));
172-
172+
173173 assertEquals (1 , nested .size ());
174174 assertEquals ("nestedValue" , nested .get ("nestedKey" ));
175175 }
176- }
176+ }
0 commit comments