2222import java .util .Map ;
2323import java .util .Set ;
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 MutableCapabilities implements Capabilities {
2831
2932 private static final Set <String > OPTION_KEYS ;
@@ -81,7 +84,7 @@ public void setCapability(String capabilityName, Platform value) {
8184 setCapability (capabilityName , (Object ) value );
8285 }
8386
84- public void setCapability (String key , Object value ) {
87+ public void setCapability (String key , @ Nullable Object value ) {
8588 Require .nonNull ("Capability name" , key );
8689
8790 // We have to special-case some keys and values because of the popular idiom of calling
@@ -107,7 +110,7 @@ public Map<String, Object> asMap() {
107110 }
108111
109112 @ Override
110- public Object getCapability (String capabilityName ) {
113+ public @ Nullable Object getCapability (String capabilityName ) {
111114 return caps .get (capabilityName );
112115 }
113116
@@ -126,7 +129,7 @@ public int hashCode() {
126129 }
127130
128131 @ Override
129- public boolean equals (Object o ) {
132+ public boolean equals (@ Nullable Object o ) {
130133 if (!(o instanceof Capabilities )) {
131134 return false ;
132135 }
0 commit comments