2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertNotNull;
13 import static org.junit.Assert.assertNull;
14 import static org.junit.Assert.assertTrue;
16 import java.util.ArrayList;
17 import java.util.List;
18 import org.junit.Test;
19 import org.opendaylight.mdsal.binding.model.util.Types;
20 import org.opendaylight.mdsal.binding.model.api.AnnotationType;
21 import org.opendaylight.mdsal.binding.model.api.AnnotationType.Parameter;
22 import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
23 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
24 import org.opendaylight.mdsal.binding.model.api.type.builder.AnnotationTypeBuilder;
25 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder;
26 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTOBuilder;
27 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
28 import org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder;
30 public class AnnotationBuilderTest {
33 public void generatedTypeAnnotationTest() {
34 final GeneratedTypeBuilder genTypeBuilder = new GeneratedTypeBuilderImpl("org.opendaylight.controller",
37 genTypeBuilder.addAnnotation("javax.management", "MXBean");
38 final AnnotationTypeBuilder annotDesc = genTypeBuilder.addAnnotation("javax.management", "Description");
39 annotDesc.addParameter("description", "some sort of interface");
41 final GeneratedType genType = genTypeBuilder.toInstance();
43 assertNotNull(genType);
44 assertNotNull(genType.getAnnotations());
45 assertEquals(2, genType.getAnnotations().size());
48 for (final AnnotationType annotation : genType.getAnnotations()) {
49 if (annotation.getPackageName().equals("javax.management") && annotation.getName().equals("MXBean")) {
51 assertEquals(0, annotation.getParameters().size());
53 if (annotation.getPackageName().equals("javax.management") && annotation.getName().equals("Description")) {
55 assertEquals(1, annotation.getParameters().size());
56 AnnotationType.Parameter param = annotation.getParameter("description");
58 assertEquals("description", param.getName());
59 assertNotNull(param.getValue());
60 assertEquals("some sort of interface", param.getValue());
61 assertNotNull(param.getValues());
62 assertTrue(param.getValues().isEmpty());
65 assertEquals(2, annotCount);
69 public void methodSignatureAnnotationTest() {
70 final GeneratedTypeBuilder genTypeBuilder = new GeneratedTypeBuilderImpl("org.opendaylight.controller",
73 final MethodSignatureBuilder methodBuilder = genTypeBuilder.addMethod("simpleMethod");
74 methodBuilder.setReturnType(Types.typeForClass(Integer.class));
75 final AnnotationTypeBuilder annotManAttr = methodBuilder.addAnnotation(
76 "org.springframework.jmx.export.annotation", "ManagedAttribute");
78 annotManAttr.addParameter("description", "\"The Name Attribute\"");
79 annotManAttr.addParameter("currencyTimeLimit", "20");
80 annotManAttr.addParameter("defaultValue", "\"bar\"");
81 annotManAttr.addParameter("persistPolicy", "\"OnUpdate\"");
83 final AnnotationTypeBuilder annotManProp = methodBuilder.addAnnotation(
84 "org.springframework.jmx.export.annotation", "ManagedOperation");
86 final List<String> typeValues = new ArrayList<String>();
87 typeValues.add("\"val1\"");
88 typeValues.add("\"val2\"");
89 typeValues.add("\"val3\"");
90 annotManProp.addParameters("types", typeValues);
92 final GeneratedType genType = genTypeBuilder.toInstance();
94 assertNotNull(genType);
95 assertNotNull(genType.getAnnotations());
96 assertNotNull(genType.getMethodDefinitions());
97 assertNotNull(genType.getMethodDefinitions().get(0));
98 assertNotNull(genType.getMethodDefinitions().get(0).getAnnotations());
99 final List<AnnotationType> annotations = genType.getMethodDefinitions().get(0).getAnnotations();
100 assertEquals(2, annotations.size());
103 for (final AnnotationType annotation : annotations) {
104 if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
105 && annotation.getName().equals("ManagedAttribute")) {
107 assertEquals(4, annotation.getParameters().size());
109 assertNotNull(annotation.getParameter("description"));
110 assertNotNull(annotation.getParameter("currencyTimeLimit"));
111 assertNotNull(annotation.getParameter("defaultValue"));
112 assertNotNull(annotation.getParameter("persistPolicy"));
113 assertEquals("\"The Name Attribute\"", annotation.getParameter("description").getValue());
114 assertEquals("20", annotation.getParameter("currencyTimeLimit").getValue());
115 assertEquals("\"bar\"", annotation.getParameter("defaultValue").getValue());
116 assertEquals("\"OnUpdate\"", annotation.getParameter("persistPolicy").getValue());
118 if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
119 && annotation.getName().equals("ManagedOperation")) {
122 assertEquals(1, annotation.getParameters().size());
123 assertNotNull(annotation.getParameter("types"));
124 assertEquals(3, annotation.getParameter("types").getValues().size());
127 assertEquals(2, annotCount);
131 public void generatedPropertyAnnotationTest() {
132 final GeneratedTOBuilder genTOBuilder = new CodegenGeneratedTOBuilder("org.opendaylight.controller",
135 final GeneratedPropertyBuilder propertyBuilder = genTOBuilder.addProperty("simpleProperty");
136 propertyBuilder.setReturnType(Types.typeForClass(Integer.class));
137 final AnnotationTypeBuilder annotManAttr = propertyBuilder.addAnnotation(
138 "org.springframework.jmx.export.annotation", "ManagedAttribute");
140 annotManAttr.addParameter("description", "\"The Name Attribute\"");
141 annotManAttr.addParameter("currencyTimeLimit", "20");
142 annotManAttr.addParameter("defaultValue", "\"bar\"");
143 annotManAttr.addParameter("persistPolicy", "\"OnUpdate\"");
145 final AnnotationTypeBuilder annotManProp = propertyBuilder.addAnnotation(
146 "org.springframework.jmx.export.annotation", "ManagedOperation");
148 final List<String> typeValues = new ArrayList<String>();
149 typeValues.add("\"val1\"");
150 typeValues.add("\"val2\"");
151 typeValues.add("\"val3\"");
152 annotManProp.addParameters("types", typeValues);
154 final GeneratedTransferObject genTransObj = genTOBuilder.toInstance();
156 assertNotNull(genTransObj);
157 assertNotNull(genTransObj.getAnnotations());
158 assertNotNull(genTransObj.getProperties());
159 assertNotNull(genTransObj.getProperties().get(0));
160 assertNotNull(genTransObj.getProperties().get(0).getAnnotations());
161 final List<AnnotationType> annotations = genTransObj.getProperties().get(0).getAnnotations();
162 assertEquals(2, annotations.size());
165 for (final AnnotationType annotation : annotations) {
166 if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
167 && annotation.getName().equals("ManagedAttribute")) {
169 assertEquals(4, annotation.getParameters().size());
171 assertNotNull(annotation.getParameter("description"));
172 assertNotNull(annotation.getParameter("currencyTimeLimit"));
173 assertNotNull(annotation.getParameter("defaultValue"));
174 assertNotNull(annotation.getParameter("persistPolicy"));
175 assertEquals("\"The Name Attribute\"", annotation.getParameter("description").getValue());
176 assertEquals("20", annotation.getParameter("currencyTimeLimit").getValue());
177 assertEquals("\"bar\"", annotation.getParameter("defaultValue").getValue());
178 assertEquals("\"OnUpdate\"", annotation.getParameter("persistPolicy").getValue());
180 if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
181 && annotation.getName().equals("ManagedOperation")) {
184 assertEquals(1, annotation.getParameters().size());
185 assertNotNull(annotation.getParameter("types"));
186 assertEquals(3, annotation.getParameter("types").getValues().size());
189 assertEquals(2, annotCount);
193 public void generatedTransfeObjectAnnotationTest() {
194 final GeneratedTOBuilder genTypeBuilder = new CodegenGeneratedTOBuilder("org.opendaylight.controller",
197 genTypeBuilder.addAnnotation("javax.management", "MBean");
198 final AnnotationTypeBuilder annotNotify = genTypeBuilder.addAnnotation("javax.management", "NotificationInfo");
200 final List<String> notifyList = new ArrayList<String>();
201 notifyList.add("\"my.notif.type\"");
202 annotNotify.addParameters("types", notifyList);
203 annotNotify.addParameter("description", "@Description(\"my notification\")");
205 GeneratedTransferObject genTO = genTypeBuilder.toInstance();
207 assertNotNull(genTO);
208 assertNotNull(genTO.getAnnotations());
209 assertEquals(2, genTO.getAnnotations().size());
212 for (final AnnotationType annotation : genTO.getAnnotations()) {
213 if (annotation.getPackageName().equals("javax.management") && annotation.getName().equals("MBean")) {
215 assertEquals(0, annotation.getParameters().size());
217 if (annotation.getPackageName().equals("javax.management")
218 && annotation.getName().equals("NotificationInfo")) {
220 assertEquals(2, annotation.getParameters().size());
221 AnnotationType.Parameter param = annotation.getParameter("types");
222 assertNotNull(param);
223 assertEquals("types", param.getName());
224 assertNull(param.getValue());
225 assertNotNull(param.getValues());
226 assertEquals(1, param.getValues().size());
227 assertEquals("\"my.notif.type\"", param.getValues().get(0));
229 param = annotation.getParameter("description");
230 assertNotNull(param);
231 assertEquals("description", param.getName());
232 assertNotNull(param.getValue());
233 assertEquals("@Description(\"my notification\")", param.getValue());
236 assertEquals(2, annotCount);
240 public void annotationTypeBuilderAddAnnotationTest() {
241 AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl("my.package", "MyName");
243 assertNull(annotationTypeBuilder.addAnnotation("my.package", null));
244 assertNull(annotationTypeBuilder.addAnnotation(null, "MyName"));
246 assertNotNull(annotationTypeBuilder.addAnnotation("", ""));
248 assertNotNull(annotationTypeBuilder.addAnnotation("my.package2", "MyName2"));
249 assertNull(annotationTypeBuilder.addAnnotation("my.package2", "MyName2"));
251 AnnotationType annotationTypeInstance = annotationTypeBuilder.toInstance();
253 assertEquals(2, annotationTypeInstance.getAnnotations().size());
255 assertEquals("my.package", annotationTypeInstance.getPackageName());
256 assertEquals("MyName", annotationTypeInstance.getName());
261 public void annotationTypeBuilderEqualsTest() {
262 AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl("my.package", "MyName");
263 AnnotationTypeBuilder annotationTypeBuilder2 = new AnnotationTypeBuilderImpl("my.package2", "MyName");
264 AnnotationTypeBuilder annotationTypeBuilder3 = new AnnotationTypeBuilderImpl("my.package", "MyName2");
265 AnnotationTypeBuilder annotationTypeBuilder4 = new AnnotationTypeBuilderImpl("my.package", "MyName");
267 assertFalse(annotationTypeBuilder.equals(null));
268 assertFalse(annotationTypeBuilder.equals(new Object()));
270 assertTrue(annotationTypeBuilder.equals(annotationTypeBuilder));
272 assertTrue(annotationTypeBuilder.equals(annotationTypeBuilder4));
273 assertFalse(annotationTypeBuilder.equals(annotationTypeBuilder2));
274 assertFalse(annotationTypeBuilder.equals(annotationTypeBuilder3));
276 AnnotationType instance = annotationTypeBuilder.toInstance();
277 AnnotationType instance2 = annotationTypeBuilder2.toInstance();
278 AnnotationType instance3 = annotationTypeBuilder3.toInstance();
279 AnnotationType instance4 = annotationTypeBuilder4.toInstance();
281 assertFalse(instance.equals(null));
282 assertFalse(instance.equals(new Object()));
283 assertTrue(instance.equals(instance));
285 assertFalse(instance.equals(instance2));
286 assertFalse(instance.equals(instance3));
287 assertTrue(instance.equals(instance4));
289 annotationTypeBuilder.addParameter("myName", "myValue1");
290 annotationTypeBuilder.addParameter("myName2", "myValue2");
291 annotationTypeBuilder2.addParameter("myName", "myValue3");
293 instance = annotationTypeBuilder.toInstance();
294 instance2 = annotationTypeBuilder2.toInstance();
296 Parameter parameter = instance.getParameter("myName");
297 Parameter parameter2 = instance.getParameter("myName2");
298 Parameter parameter3 = instance2.getParameter("myName");
300 assertFalse(parameter.equals(null));
301 assertFalse(parameter.equals(new Object()));
302 assertTrue(parameter.equals(parameter));
303 assertTrue(parameter.equals(parameter3));
304 assertFalse(parameter.equals(parameter2));
308 public void annotationTypeBuilderHashCodeTest() {
309 AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl("my.package", "MyName");
310 AnnotationTypeBuilder annotationTypeBuilder2 = new AnnotationTypeBuilderImpl("my.package2", "MyName");
311 AnnotationTypeBuilder annotationTypeBuilder3 = new AnnotationTypeBuilderImpl("my.package", "MyName2");
312 AnnotationTypeBuilder annotationTypeBuilder4 = new AnnotationTypeBuilderImpl("my.package", "MyName");
314 assertFalse(annotationTypeBuilder.hashCode() == annotationTypeBuilder2.hashCode());
315 assertFalse(annotationTypeBuilder.hashCode() == annotationTypeBuilder3.hashCode());
317 assertTrue(annotationTypeBuilder.hashCode() == annotationTypeBuilder4.hashCode());
318 assertTrue(annotationTypeBuilder.hashCode() == annotationTypeBuilder.hashCode());
320 AnnotationType instance = annotationTypeBuilder.toInstance();
321 AnnotationType instance2 = annotationTypeBuilder2.toInstance();
322 AnnotationType instance3 = annotationTypeBuilder3.toInstance();
323 AnnotationType instance4 = annotationTypeBuilder4.toInstance();
325 assertFalse(instance.hashCode() == instance2.hashCode());
326 assertFalse(instance.hashCode() == instance3.hashCode());
328 assertTrue(instance.hashCode() == instance4.hashCode());
329 assertTrue(instance.hashCode() == instance.hashCode());
331 annotationTypeBuilder.addParameter("myName", "myValue1");
332 annotationTypeBuilder.addParameter("myName2", "myValue2");
333 annotationTypeBuilder2.addParameter("myName", "myValue3");
335 instance = annotationTypeBuilder.toInstance();
336 instance2 = annotationTypeBuilder2.toInstance();
338 Parameter parameter = instance.getParameter("myName");
339 Parameter parameter2 = instance.getParameter("myName2");
340 Parameter parameter3 = instance2.getParameter("myName");
342 assertTrue(parameter.hashCode() == parameter.hashCode());
343 assertTrue(parameter.hashCode() == parameter3.hashCode());
344 assertFalse(parameter.hashCode() == parameter2.hashCode());
349 public void annotationTypeBuilderAddParameterTest() {
350 AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl("my.package", "MyName");
352 assertFalse(annotationTypeBuilder.addParameter(null, "myValue"));
353 assertFalse(annotationTypeBuilder.addParameter("myName", null));
355 assertFalse(annotationTypeBuilder.addParameters(null, new ArrayList<String>()));
356 assertFalse(annotationTypeBuilder.addParameters("myName", null));
358 assertTrue(annotationTypeBuilder.addParameter("myName", "myValue"));
359 assertFalse(annotationTypeBuilder.addParameter("myName", "myValue"));
360 assertFalse(annotationTypeBuilder.addParameters("myName", new ArrayList<String>()));
362 ArrayList<String> values = new ArrayList<String>();
363 values.add("myValue");
364 assertTrue(annotationTypeBuilder.addParameters("myName2", values));
366 AnnotationType annotationTypeInstance = annotationTypeBuilder.toInstance();
367 assertTrue(annotationTypeInstance.containsParameters());
368 assertEquals(2, annotationTypeInstance.getParameters().size());
369 assertEquals(2, annotationTypeInstance.getParameterNames().size());
370 assertTrue(annotationTypeInstance.getParameterNames().contains("myName"));
371 assertTrue(annotationTypeInstance.getParameterNames().contains("myName2"));
372 assertFalse(annotationTypeInstance.getParameterNames().contains("myName3"));
374 Parameter parameter = annotationTypeInstance.getParameter("myName");
375 Parameter parameter2 = annotationTypeInstance.getParameter("myName2");
376 Parameter parameter3 = annotationTypeInstance.getParameter("myName3");
378 assertNotNull(parameter);
379 assertNotNull(parameter2);
380 assertNull(parameter3);
382 assertEquals(parameter.getValue(), "myValue");
383 assertTrue(parameter.getValues().isEmpty());
385 assertEquals(1, parameter2.getValues().size());
386 assertTrue(parameter2.getValues().contains("myValue"));
391 public void annotationTypeBuilderToStringTest() {
392 AnnotationTypeBuilder annotationTypeBuilder = new AnnotationTypeBuilderImpl("my.package", "MyAnnotationName");
393 annotationTypeBuilder.addAnnotation("my.package", "MySubAnnotationName");
394 annotationTypeBuilder.addParameter("MyParameter", "myValue");
397 "AnnotationTypeBuilder [packageName=my.package, name=MyAnnotationName, annotationBuilders=[AnnotationTypeBuilder [packageName=my.package, name=MySubAnnotationName, annotationBuilders=[], parameters=[]]], parameters=[ParameterImpl [name=MyParameter, value=myValue, values=[]]]]",
398 annotationTypeBuilder.toString());
400 AnnotationType annotationTypeInstance = annotationTypeBuilder.toInstance();
402 assertEquals("my.package.MyAnnotationName", annotationTypeInstance.getFullyQualifiedName());
404 "AnnotationType [packageName=my.package, name=MyAnnotationName, annotations=[AnnotationType [packageName=my.package, name=MySubAnnotationName, annotations=[], parameters=[]]], parameters=[ParameterImpl [name=MyParameter, value=myValue, values=[]]]]",
405 annotationTypeInstance.toString());
409 public void testAddAnnotation() {
410 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
411 annotBuilderImpl.addAnnotation("org.opedaylight.yangtools.test.v1", "AnnotationTest2");
412 annotBuilderImpl.addAnnotation(null, "AnnotationTest2");
413 assertFalse(annotBuilderImpl.toInstance().getAnnotations().isEmpty());
417 public void testAddParameterMethod() {
418 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
419 annotBuilderImpl.addParameter("testParam", "test value");
420 annotBuilderImpl.addParameter(null, "test value");
421 final AnnotationType annotType = annotBuilderImpl.toInstance();
422 assertEquals(1, annotType.getParameters().size());
426 public void testAddParametersMethod() {
427 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
429 final List<String> values = new ArrayList<>();
433 annotBuilderImpl.addParameters("testParam", values);
435 AnnotationType annotType = annotBuilderImpl.toInstance();
436 assertEquals(1, annotType.getParameters().size());
438 annotBuilderImpl.addParameters("testParam", null);
440 annotType = annotBuilderImpl.toInstance();
441 assertEquals(1, annotType.getParameters().size());
445 public void testHashCode() {
446 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
447 final AnnotationTypeBuilderImpl annotBuilderImpl2 = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest2");
448 assertFalse(annotBuilderImpl.hashCode() == annotBuilderImpl2.hashCode());
452 public void testEquals() {
453 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
454 final AnnotationTypeBuilderImpl annotBuilderImpl2 = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
455 final AnnotationTypeBuilderImpl annotBuilderImpl3 = annotBuilderImpl2;
457 assertTrue(annotBuilderImpl.equals(annotBuilderImpl2));
458 assertTrue(annotBuilderImpl2.equals(annotBuilderImpl3));
459 assertFalse(annotBuilderImpl2.equals(null));
460 assertFalse(annotBuilderImpl2.equals("test"));
464 public void testToString() {
465 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
466 assertNotNull(annotBuilderImpl.toString());
470 public void testMethodsForAnnotationTypeImpl() {
471 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
472 annotBuilderImpl.addParameter("testParam", "test value");
473 final AnnotationType annotationType = annotBuilderImpl.toInstance();
475 final AnnotationTypeBuilderImpl annotBuilderImpl2 = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
476 final AnnotationType annotationType2 = annotBuilderImpl2.toInstance();
478 assertTrue(annotationType.containsParameters());
479 assertTrue(annotationType.getAnnotations().isEmpty());
480 assertNotNull(annotationType.getFullyQualifiedName());
481 assertNotNull(annotationType.getName());
482 assertNotNull(annotationType.getPackageName());
483 assertNull(annotationType.getParameter(null));
484 assertNotNull(annotationType.getParameter("testParam"));
485 assertFalse(annotationType.getParameterNames().isEmpty());
486 assertFalse(annotationType.getParameters().isEmpty());
488 assertTrue(annotationType.hashCode() == annotationType2.hashCode());
489 assertTrue(annotationType.equals(annotationType2));
490 assertNotNull(annotationType.toString());
494 public void testMethodsForParameterImpl() {
495 final AnnotationTypeBuilderImpl annotBuilderImpl = new AnnotationTypeBuilderImpl("org.opedaylight.yangtools.test", "AnnotationTest");
496 annotBuilderImpl.addParameter("testParam", "test value");
497 annotBuilderImpl.addParameter("testParam", "test value");
498 annotBuilderImpl.addParameter("", "test value");
499 annotBuilderImpl.addParameter(null, "test value");
500 annotBuilderImpl.addParameter("", null);
501 final AnnotationType annotationType = annotBuilderImpl.toInstance();
503 final Parameter testParam = annotationType.getParameter("testParam");
504 assertEquals("testParam", testParam.getName());
505 assertEquals("test value", testParam.getValue());
506 assertEquals(0, testParam.getValues().size());
508 final List<Parameter> testParams = annotationType.getParameters();
509 final Parameter sameParam = testParams.get(0);
511 assertFalse(testParams.get(0).equals(testParams.get(1)));
512 assertFalse(testParams.get(0).equals(null));
513 assertFalse(testParams.get(0).equals("test"));
514 assertTrue(testParams.get(0).equals(sameParam));
515 assertFalse(testParams.get(0).hashCode() == testParams.get(1).hashCode());
516 assertTrue(testParams.get(0).hashCode() == testParams.get(0).hashCode());