2222import  java .util .Collections ;
2323import  java .util .Map ;
2424import  java .util .TreeMap ;
25+ import  org .jspecify .annotations .NullMarked ;
26+ import  org .jspecify .annotations .Nullable ;
2527import  org .openqa .selenium .internal .Require ;
2628
29+ @ NullMarked 
2730public  class  ImmutableCapabilities  implements  Capabilities  {
2831
2932  private  final  Map <String , Object > delegate ;
@@ -145,18 +148,17 @@ public ImmutableCapabilities(Map<?, ?> capabilities) {
145148    capabilities .forEach (
146149        (key , value ) -> {
147150          Require .argument ("Capability key" , key ).instanceOf (String .class );
148-           Object  v  = capabilities .get (key );
149151          Require .nonNull ("Capability value" , value );
150152
151-           setCapability (delegate , (String ) key , v );
153+           setCapability (delegate , (String ) key , value );
152154        });
153155
154156    this .delegate  = Collections .unmodifiableMap (delegate );
155157    this .hashCode  = SharedCapabilitiesMethods .hashCode (this );
156158  }
157159
158160  @ Override 
159-   public  Object  getCapability (String  capabilityName ) {
161+   public  @ Nullable   Object  getCapability (String  capabilityName ) {
160162    Require .nonNull ("Capability name" , capabilityName );
161163    return  delegate .get (capabilityName );
162164  }
@@ -172,7 +174,7 @@ public int hashCode() {
172174  }
173175
174176  @ Override 
175-   public  boolean  equals (Object  o ) {
177+   public  boolean  equals (@ Nullable   Object  o ) {
176178    if  (!(o  instanceof  Capabilities )) {
177179      return  false ;
178180    }
0 commit comments