1515import static io .opentelemetry .api .common .AttributeKey .stringKey ;
1616import static io .opentelemetry .sdk .testing .assertj .OpenTelemetryAssertions .assertThat ;
1717import static io .opentelemetry .sdk .testing .assertj .OpenTelemetryAssertions .equalTo ;
18+ import static java .util .Collections .singletonList ;
1819import static java .util .stream .Collectors .joining ;
1920import static org .assertj .core .api .Assertions .assertThatCode ;
2021import static org .assertj .core .api .Assertions .assertThatThrownBy ;
@@ -135,7 +136,7 @@ void nothingChangedAfterEnd() {
135136 spanData ,
136137 Attributes .empty (),
137138 Collections .emptyList (),
138- Collections . singletonList (link ),
139+ singletonList (link ),
139140 SPAN_NAME ,
140141 START_EPOCH_NANOS ,
141142 START_EPOCH_NANOS ,
@@ -251,8 +252,8 @@ void toSpanData_ActiveSpan() {
251252 verifySpanData (
252253 spanData ,
253254 expectedAttributes ,
254- Collections . singletonList (event ),
255- Collections . singletonList (link ),
255+ singletonList (event ),
256+ singletonList (link ),
256257 SPAN_NEW_NAME ,
257258 START_EPOCH_NANOS ,
258259 0 ,
@@ -282,8 +283,8 @@ void toSpanData_EndedSpan() {
282283 verifySpanData (
283284 spanData ,
284285 expectedAttributes ,
285- Collections . singletonList (event ),
286- Collections . singletonList (link ),
286+ singletonList (event ),
287+ singletonList (link ),
287288 SPAN_NEW_NAME ,
288289 START_EPOCH_NANOS ,
289290 testClock .now (),
@@ -466,7 +467,8 @@ void getAttributes_Empty() {
466467 }
467468
468469 @ Test
469- @ SuppressWarnings ("deprecation" ) // Testing deprecated code
470+ @ SuppressWarnings ("deprecation" )
471+ // Testing deprecated code
470472 void getInstrumentationLibraryInfo () {
471473 SdkSpan span = createTestSpan (SpanKind .CLIENT );
472474 try {
@@ -552,13 +554,10 @@ void setAttribute() {
552554 span .setAttribute (doubleArrayKey ("NullArrayDoubleKey" ), null );
553555 span .setAttribute (booleanArrayKey ("NullArrayBooleanKey" ), null );
554556 // These should be maintained
555- span .setAttribute (longArrayKey ("ArrayWithNullLongKey" ), Arrays .asList (new Long [] {null }));
556- span .setAttribute (
557- stringArrayKey ("ArrayWithNullStringKey" ), Arrays .asList (new String [] {null }));
558- span .setAttribute (
559- doubleArrayKey ("ArrayWithNullDoubleKey" ), Arrays .asList (new Double [] {null }));
560- span .setAttribute (
561- booleanArrayKey ("ArrayWithNullBooleanKey" ), Arrays .asList (new Boolean [] {null }));
557+ span .setAttribute (longArrayKey ("ArrayWithNullLongKey" ), singletonList (null ));
558+ span .setAttribute (stringArrayKey ("ArrayWithNullStringKey" ), singletonList (null ));
559+ span .setAttribute (doubleArrayKey ("ArrayWithNullDoubleKey" ), singletonList (null ));
560+ span .setAttribute (booleanArrayKey ("ArrayWithNullBooleanKey" ), singletonList (null ));
562561 } finally {
563562 span .end ();
564563 }
@@ -691,10 +690,10 @@ void setAllAttributes() {
691690 .put (doubleArrayKey ("NullArrayDoubleKey" ), (Double []) null )
692691 .put (booleanArrayKey ("NullArrayBooleanKey" ), (Boolean []) null )
693692 // These should be maintained
694- .put (longArrayKey ("ArrayWithNullLongKey" ), Arrays . asList ( new Long [] { null } ))
695- .put (stringArrayKey ("ArrayWithNullStringKey" ), Arrays . asList ( new String [] { null } ))
696- .put (doubleArrayKey ("ArrayWithNullDoubleKey" ), Arrays . asList ( new Double [] { null } ))
697- .put (booleanArrayKey ("ArrayWithNullBooleanKey" ), Arrays . asList ( new Boolean [] { null } ))
693+ .put (longArrayKey ("ArrayWithNullLongKey" ), singletonList ( null ))
694+ .put (stringArrayKey ("ArrayWithNullStringKey" ), singletonList ( null ))
695+ .put (doubleArrayKey ("ArrayWithNullDoubleKey" ), singletonList ( null ))
696+ .put (booleanArrayKey ("ArrayWithNullBooleanKey" ), singletonList ( null ))
698697 .build ();
699698
700699 try {
@@ -1315,7 +1314,7 @@ public void setExceptionAttributes(
13151314 SpanLimits .getDefault (),
13161315 parentSpanId ,
13171316 null ,
1318- Collections . singletonList (link ),
1317+ singletonList (link ),
13191318 exceptionAttributeResolver );
13201319
13211320 span .recordException (new IllegalStateException ("error" ));
@@ -1462,7 +1461,7 @@ private SdkSpan createTestSpanWithAttributes(Map<AttributeKey, Object> attribute
14621461 SpanLimits .getDefault (),
14631462 null ,
14641463 attributesMap ,
1465- Collections . singletonList (link ),
1464+ singletonList (link ),
14661465 ExceptionAttributeResolver .getDefault ());
14671466 }
14681467
@@ -1472,7 +1471,7 @@ private SdkSpan createTestRootSpan() {
14721471 SpanLimits .getDefault (),
14731472 SpanId .getInvalid (),
14741473 null ,
1475- Collections . singletonList (link ),
1474+ singletonList (link ),
14761475 ExceptionAttributeResolver .getDefault ());
14771476 }
14781477
@@ -1482,7 +1481,7 @@ private SdkSpan createTestSpan(SpanKind kind) {
14821481 SpanLimits .getDefault (),
14831482 parentSpanId ,
14841483 null ,
1485- Collections . singletonList (link ),
1484+ singletonList (link ),
14861485 ExceptionAttributeResolver .getDefault ());
14871486 }
14881487
@@ -1492,7 +1491,7 @@ private SdkSpan createTestSpan(SpanLimits config) {
14921491 config ,
14931492 parentSpanId ,
14941493 null ,
1495- Collections . singletonList (link ),
1494+ singletonList (link ),
14961495 ExceptionAttributeResolver .getDefault ());
14971496 }
14981497
@@ -1611,7 +1610,7 @@ void testAsSpanData() {
16111610 clock ,
16121611 resource ,
16131612 attributesWithCapacity ,
1614- Collections . singletonList (link1 ),
1613+ singletonList (link1 ),
16151614 1 ,
16161615 0 );
16171616 long startEpochNanos = clock .now ();
@@ -1638,7 +1637,7 @@ void testAsSpanData() {
16381637 result ,
16391638 attributesWithCapacity ,
16401639 events ,
1641- Collections . singletonList (link1 ),
1640+ singletonList (link1 ),
16421641 name ,
16431642 startEpochNanos ,
16441643 endEpochNanos ,
0 commit comments