-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] [refactor] replace most of Guava collections by Java built-in collections #16776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java] [refactor] replace most of Guava collections by Java built-in collections #16776
Conversation
|
Thank you, @asolntsev for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
Arrays.asList by List.of
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||||||
|
Also, I saw Puja has made a few PRs for Grid to do the same. Should we resume her PR work? |
35c922d to
4b625a3
Compare
java/src/org/openqa/selenium/grid/commands/EventBusCommand.java
Outdated
Show resolved
Hide resolved
java/src/org/openqa/selenium/grid/config/ConcatenatingConfig.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelectorTest.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/grid/distributor/selector/GreedySlotSelectorTest.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutatorTest.java
Outdated
Show resolved
Hide resolved
java/test/org/openqa/selenium/grid/node/local/LocalNodeTest.java
Outdated
Show resolved
Hide resolved
`List.of` is preferred because it 1. Optimized, and 2. Returns a truly immutable object. While `Arrays.asList` returns a list that allows modifications, e.g. using method `*.set(index, value)`.
Guava's method `ImmutableMap.of` was needed until in Java 8 edge, when Java didn't have its own constructor for Maps. Nowadays `Map.of` is the proper way to create maps.
Guava's method `ImmutableList.of` was needed until in Java 8 edge, when Java didn't have its own constructor for Lists. Nowadays `List.of` is the proper way to create immutable lists.
Guava's method `ImmutableSet.of` was needed until in Java 8 edge, when Java didn't have its own constructor for Sets. Nowadays `Set.of` is the proper way to create immutable Sets. Sometimes we still need to use `ImmutableSet` - where we need to keep the order of elements.
4b625a3 to
b32ed2d
Compare
b32ed2d to
496a2a6
Compare
All the requested changes have been implemented.
User description
List.ofis preferred because itWhile
Arrays.asListreturns a list that allows modifications, e.g. using method*.set(index, value).🔄 Types of changes
PR Type
Enhancement, Tests
Description
This comprehensive refactoring replaces Guava collection utilities with Java built-in equivalents across the Selenium codebase:
Key Changes:
Replaced
ImmutableMap.of()withMap.of()for immutable map creationReplaced
ImmutableList.of()andArrays.asList()withList.of()for immutable listsReplaced
ImmutableSet.of()withSet.of()for immutable setsReplaced
ImmutableMap.copyOf()withMap.copyOf(),ImmutableList.copyOf()withList.copyOf(), andImmutableSet.copyOf()withSet.copyOf()Replaced Guava collectors (
toImmutableList(),toImmutableSet(),toImmutableMap()) with Java stream collectors (toUnmodifiableList(),toUnmodifiableSet(),toUnmodifiableMap())Refactored builder patterns to use Java's native collection factory methods
Removed all Guava collection imports (
ImmutableList,ImmutableMap,ImmutableSet)Added static imports for
emptyList(),emptyMap(),emptySet()fromjava.util.CollectionsBenefits:
Java built-in collections are optimized and return truly immutable objects
Reduces external dependency on Guava library
Improves code clarity and maintainability
Leverages modern Java features (Java 9+ factory methods)
Scope:
80+ files modified across test and source code
Includes grid, remote, devtools, docker, and configuration modules
Some files include additional refactoring (e.g., extracting helper methods, improving assertions, modernizing test parameterization)
Diagram Walkthrough
File Walkthrough
41 files
RemoteWebDriverUnitTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/remote/RemoteWebDriverUnitTest.java
ImmutableMap.of()with JavaMap.of()throughout thetest file
Arrays.asList()with JavaList.of()for immutable listcreation
UUID.randomUUID()and consolidated wildcardimport for
java.util.*ImmutableMapimport and consolidated individualjava.utilimportsRemoteWebElementTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/remote/RemoteWebElementTest.java
ImmutableMap.of()calls withMap.of()throughout testassertions
ImmutableMapimport and addedjava.util.Mapimportmethod
GreedySlotSelectorTest.java
Replace Guava collections with Java equivalents in testsjava/test/org/openqa/selenium/grid/distributor/selector/GreedySlotSelectorTest.java
ImmutableList.of()withList.of()for test data creationImmutableMap.of()withMap.of()for capability mapsclasses
java.util.*imports into wildcard importcreateNodeWithStereotypes(List)method overloadJsonOutputTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/json/JsonOutputTest.java
ImmutableMap.of()calls withMap.of()throughout testfile
Arrays.asList()withList.of()for immutable list creationImmutableMapimport andArraysimportasListfromjava.util.ArraysExecutingJavascriptTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/ExecutingJavascriptTest.java
ImmutableList.of()withList.of()for immutable list creationImmutableMap.of()withMap.of()for immutable map creationArrays.asList()withList.of()compareLists()helper method@SuppressWarnings("unchecked")annotation where no longerneeded
ImmutableListandImmutableMapLocalNodeTest.java
Replace Guava collections with Java equivalentsjava/test/org/openqa/selenium/grid/node/local/LocalNodeTest.java
ImmutableSet.of()withSet.of()for immutable set creationImmutableMap.of()withemptyMap()for empty mapsjava.util.*imports into wildcard importImmutableMapandImmutableSetimportsemptyMap()fromjava.util.CollectionsDefaultSlotSelectorTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelectorTest.java
ImmutableList.of()withList.of()for test dataImmutableMap.of()withMap.of()for capability mapsjava.util.*imports into wildcard importStreamimport for stream operationsListtoList>NewSessionPayloadTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/remote/NewSessionPayloadTest.java
ImmutableMap.of()withMap.of()throughout test fileArrays.asList()withList.of()for immutable list creationasListfromjava.util.ArraysImmutableMapimportNodeTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/node/NodeTest.java
ImmutableSet.of()withSet.of()andImmutableSet.copyOf()with
EnumSet.allOf()ImmutableMap.of()withemptyMap()for empty mapsjava.util.*imports into wildcard importImmutableMapandImmutableSetimportsemptyMap()andemptySet()fromjava.util.CollectionsLocalNode.java
Replace Guava collections with Java built-in equivalentsjava/src/org/openqa/selenium/grid/node/local/LocalNode.java
ImmutableList.copyOf()withList.copyOf()for immutable listcreation
Arrays.asList()withList.of()for immutable list creationtoImmutableSet()collector withtoUnmodifiableSet()fromjava.util.stream.CollectorsTickeranonymous class to lambda expressionBuilder.factoriesfromImmutableList.BuildertoArrayListImmutableListimport and related static importsStubNetworkInterfaceProvider.java
Replace Arrays.asList with List.of()java/test/org/openqa/selenium/net/StubNetworkInterfaceProvider.java
Arrays.asList()calls withList.of()for immutable listcreation
java.util.Arraystojava.util.ListContainerConfig.java
Replace Guava collections with Java built-in equivalentsjava/src/org/openqa/selenium/docker/ContainerConfig.java
ImmutableMap.of()withMap.of()throughout the classImmutableList.of()withemptyList()for empty listinitialization
ImmutableMap.copyOf()withMap.copyOf()for immutable mapcreation
emptyList()fromjava.util.CollectionsImmutableListandImmutableMapimportstoJson()method return immutable map usingMap.copyOf()SessionCapabilitiesMutatorTest.java
Replace Arrays.asList with List.of()java/test/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutatorTest.java
Arrays.asList()withList.of()for immutable list creationCollections.singletonList()withList.of()for single-elementlists
java.util.*imports into wildcard importArrayListwrapping of list literalsCustomLocatorHandler.java
Replace Guava collections with Java built-in equivalentsjava/src/org/openqa/selenium/grid/node/CustomLocatorHandler.java
ImmutableSet.of()withSet.of()for immutable set creationImmutableMap.of()withMap.of()for immutable map creationImmutableMapandImmutableSetimportsIOExceptionimportCompoundConfig.java
Replace Guava collections with Java built-in equivalentsjava/src/org/openqa/selenium/grid/config/CompoundConfig.java
ImmutableList.copyOf()withList.of()for immutable listcreation
toImmutableList()collector withtoUnmodifiableList()fromjava.util.stream.CollectorsImmutableListimport and related static importsNodeOptionsTest.java
Replace Guava collections with Java built-in Map.of()java/test/org/openqa/selenium/grid/node/config/NodeOptionsTest.java
ImmutableMapandemptyMapimports, replaced with JavaMap.of()singletonMap()withMap.of()for immutable map creationImmutableMap.of()withMap.of()throughout test casesMapConfig(emptyMap())toMapConfig()constructor callJsonTest.java
Replace Guava collections with Java built-in Map and Listjava/test/org/openqa/selenium/json/JsonTest.java
ImmutableMapimport, replaced with JavaMap.of()Arrays.asList()withList.of()for immutable listsImmutableMap.of()calls withMap.of()ConfigTest.java
Replace Guava immutable collections with Java built-insjava/test/org/openqa/selenium/grid/config/ConfigTest.java
ImmutableListandImmutableMapimportsImmutableMap.of()withMap.of()throughoutImmutableList.of()withList.of()MapConfig(ImmutableMap.of())toMapConfig()constructorNewSessionCreationTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/router/NewSessionCreationTest.java
ImmutableList,ImmutableMap,ImmutableSetimportsemptyList()andemptySet()static importsImmutableMap.of()withMap.of()ImmutableList.of()withemptyList()ImmutableSet.of()withemptySet()MapConfig(ImmutableMap.of())toMapConfig()ErrorHandlerTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/remote/ErrorHandlerTest.java
ImmutableMapimportImmutableMap.of()calls withMap.of()WebElementToJsonConverterTest.java
Replace Guava collections with Java built-in Map and Listjava/test/org/openqa/selenium/remote/WebElementToJsonConverterTest.java
ImmutableMapimportImmutableMap.of()withMap.of()asList()calls withList.of()LocalNodeRegistry.java
Replace Guava immutable collections with Java built-insjava/src/org/openqa/selenium/grid/distributor/local/LocalNodeRegistry.java
ImmutableMapandImmutableSetimportstoUnmodifiableSet()ImmutableMap.copyOf()withMap.copyOf()ImmutableSet.toImmutableSet()withtoUnmodifiableSet()ImmutableSet.of()withSet.of()SessionQueueGridTest.java
Replace Guava collections with Java built-in Map and Listjava/test/org/openqa/selenium/grid/router/SessionQueueGridTest.java
ImmutableMapimportArraysimport, replacedArrays.asList()withList.of()ImmutableMap.of()withMap.of()JsonConfigTest.java
Replace Arrays.asList with List.of() and simplify assertionsjava/test/org/openqa/selenium/grid/config/JsonConfigTest.java
Arraysimport, replacedArrays.asList()withList.of()emptyList()static importcontainsExactly()instead ofcomparing lists
DriverServiceSessionFactoryTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/node/config/DriverServiceSessionFactoryTest.java
ImmutableMapandImmutableSetimportsemptyMap()andemptySet()static importsImmutableSet.of()withSet.of()ImmutableMap.of()withemptyMap()RemoteLogsTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/remote/RemoteLogsTest.java
ImmutableMapimportImmutableMap.of()withMap.of()CreateSessionTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/node/local/CreateSessionTest.java
ImmutableMapandImmutableSetimportsemptyMap()static importImmutableMap.of()withMap.of()ImmutableSet.of()withSet.of()ImmutableMap.of()withemptyMap()NettyServerTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/netty/server/NettyServerTest.java
ImmutableMapimportImmutableMap.of()withMap.of()MapConfig(ImmutableMap.of())toMapConfig()DeploymentTypes.java
Replace Arrays with List.of() and simplify string arraysjava/test/org/openqa/selenium/grid/router/DeploymentTypes.java
Arraysimportnew String[] {...}array with varargs inString.join()callArrays.asList()withList.of()EnsureSpecCompliantHeadersTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/web/EnsureSpecCompliantHeadersTest.java
ImmutableListandImmutableSetimportsemptyList()andemptySet()static importsImmutableList.of()withemptyList()andList.of()ImmutableSet.of()withemptySet()andSet.of()SessionCleanUpTest.java
Replace Guava collections with Java built-in equivalentsjava/test/org/openqa/selenium/grid/router/SessionCleanUpTest.java
ImmutableMapandImmutableSetimportsImmutableMap.of()withMap.of()ImmutableSet.of()withSet.of()MapConfig(ImmutableMap.of())toMapConfig()UrlTemplateTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/remote/http/UrlTemplateTest.java
ImmutableMapimportImmutableMap.of()withMap.of()LocalNewSessionQueueTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueueTest.java
ImmutableMapimportImmutableMap.of()withMap.of()ConcatenatingConfig.java
Replace Guava collections with Java stream collectorsjava/src/org/openqa/selenium/grid/config/ConcatenatingConfig.java
ImmutableListandImmutableMapimportstoUnmodifiableMap()ImmutableMap.toImmutableMap()withtoUnmodifiableMap()ImmutableList::ofwithList::ofDockerOptionsTest.java
Replace Arrays with Stream.of() and List.of()java/test/org/openqa/selenium/grid/node/docker/DockerOptionsTest.java
Arraysimport andasListstatic importArrays.stream()with array toStream.of()with varargsArrays.asList()withList.of()CdpVersionFinderTest.java
Replace Guava ImmutableList with Java List.of()java/test/org/openqa/selenium/devtools/CdpVersionFinderTest.java
ImmutableListimportImmutableList.of()withList.of()ChromeDriverServiceTest.java
Replace Arrays.asList with List.of()java/test/org/openqa/selenium/chrome/ChromeDriverServiceTest.java
ArraysimportArrays.asList()withList.of()EdgeDriverServiceTest.java
Replace Arrays.asList with List.of()java/test/org/openqa/selenium/edge/EdgeDriverServiceTest.java
ArraysimportArrays.asList()withList.of()W3CHandshakeResponseTest.java
Replace Guava ImmutableMap with Java Map.of()java/test/org/openqa/selenium/remote/W3CHandshakeResponseTest.java
ImmutableMapimportImmutableMap.of()withMap.of()EventBusCommand.java
Replace Guava collections with Java built-in equivalentsjava/src/org/openqa/selenium/grid/commands/EventBusCommand.java
ImmutableMapandImmutableSetimportsImmutableSet.of()withSet.of()ImmutableMap.of()withMap.of()Node.java
Replace Guava ImmutableMap with Java Map.of()java/src/org/openqa/selenium/grid/node/Node.java
ImmutableMapimportOS_INFOfield type fromImmutableMaptoMapImmutableMap.of()withMap.of()inloadOsInfo()methodImmutableMaptoMap44 files
CdpClientGenerator.java
Refactor to use Java built-in collections and improve code clarityjava/src/org/openqa/selenium/devtools/CdpClientGenerator.java
ImmutableMap.Builderpatterns withMap.of()for simpler mapcreation
mergeMaps()to combine maps and returnunmodifiable result
Arrays.asList()withList.of()and addedtoUnmodifiableList()collector import
String.format()readability
ReferenceTest.java
Modernize parameterized test data structurejava/test/org/openqa/selenium/docker/internal/ReferenceTest.java
Arrays.asList()with nested array toStream.of()withArguments.of()data()methodArraysimport and addedStreamimportCapabilitiesTest.java
Replace Guava maps and improve assertion methodsjava/test/org/openqa/selenium/CapabilitiesTest.java
ImmutableMap.of()withMap.of()for capability assertionsisEqualTo()tocontainsExactlyInAnyOrderEntriesOf()for map comparisonshasSameHashCodeAs()matcherImmutableMapimportSelectTest.java
Replace Arrays.asList and improve mock setupjava/test/org/openqa/selenium/support/ui/SelectTest.java
Arrays.asList()withList.of()for immutable list creationgetCssValue()method in mock optionsArgumentMatchersclass to static import ofany()method
optionBadtooptionReference.java
Replace ImmutableMap with typed DockerDomain classjava/src/org/openqa/selenium/docker/internal/Reference.java
ImmutableMap.of()with newDockerDomainrecord class forbetter type safety
DockerDomaininner class to replace map-based return valuesplitDockerDomain()toparseDockerDomain()forclarity
toLowerCase()totoLowerCase(ROOT)for explicit localespecification
ImmutableMapimportMapConfig.java
Refactor MapConfig to use Java built-in collectionsjava/src/org/openqa/selenium/grid/config/MapConfig.java
ImmutableList,ImmutableMap,ImmutableSetimportsemptyMap()static import and stream collectors for unmodifiablecollections
emptyMap()ImmutableMap.builder()ImmutableSet.copyOf()withSet.copyOf()andImmutableList.of()withList.of()Grid.java
Refactor Grid.getNodes() to use streams and Java collectorsjava/src/org/openqa/selenium/grid/graphql/Grid.java
ImmutableListimport, added stream collector importgetNodes()method from builder pattern to stream-basedapproach
ImmutableList.builder()withstream().map().collect(toUnmodifiableList())GridStatusHandler.java
Replace Guava ImmutableMap and extract node mapping logicjava/src/org/openqa/selenium/grid/router/GridStatusHandler.java
ImmutableMapimportImmutableMap.of()withMap.of()nodeAsMap()helper methodMap.of()instead of builderpattern
InternetExplorerOptions.java
Replace Arrays with Set.of() and List.of() in IE optionsjava/src/org/openqa/selenium/ie/InternetExplorerOptions.java
Arraysimport, addedemptyList()static importCAPABILITY_NAMESfromListtoSetusingSet.of()addCommandSwitches()to useList.of()instead ofArrays.asList()DefaultSlotMatcher.java
Replace Arrays.asList with List.of for immutabilityjava/src/org/openqa/selenium/grid/data/DefaultSlotMatcher.java
java.util.ArraysimportArrays.asList()calls withList.of()for immutable listcreation
ExpectedConditionsTest.java
Replace Arrays.asList with List.of in testsjava/test/org/openqa/selenium/support/ui/ExpectedConditionsTest.java
java.util.ArraysimportArrays.asList()calls withList.of()in test mock setupSafariTechPreviewDriverService.java
Simplify immutable collection creation with copyOf methodsjava/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java
java.util.*unmodifiableMapimport, replaced withMap.copyOf()List.copyOf()andMap.copyOf()insteadof wrapping with
ArrayListandHashMapcreateArgs()to useArrayListconstructor with capacity andmanual adds, returning
unmodifiableList()RetryRequestTest.java
Replace Guava ImmutableMap with Java Map.ofjava/test/org/openqa/selenium/remote/http/RetryRequestTest.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()calls withMap.of()Config.java
Replace Guava ImmutableList with List.copyOfjava/src/org/openqa/selenium/grid/config/Config.java
ImmutableListimportImmutableList.builder().addAll().build()withList.copyOf()CustomLocatorHandlerTest.java
Replace Guava ImmutableMap with Java Map.ofjava/test/org/openqa/selenium/grid/node/CustomLocatorHandlerTest.java
ImmutableMapimportImmutableMap.of()calls withMap.of()OneShotNode.java
Replace Guava immutable collections with Java built-insjava/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java
ImmutableMapandImmutableSetimportsImmutableMap.of()calls withMap.of()ImmutableSet.of()call withSet.of()RemoteWebDriverBuilderTest.java
Replace Guava ImmutableMap with Java Map.ofjava/test/org/openqa/selenium/remote/RemoteWebDriverBuilderTest.java
ImmutableMapimportImmutableMap.of()calls withMap.of()Keys.java
Replace Arrays.asList with List.ofjava/src/org/openqa/selenium/Keys.java
java.util.Arraystojava.util.ListArrays.asList()withList.of()inchord()methodProxyWebsocketTest.java
Replace Guava immutable collections with Java built-insjava/test/org/openqa/selenium/grid/router/ProxyWebsocketTest.java
ImmutableMapandImmutableSetimportsjava.util.MapimportImmutableSet.of().stream()withStream.of()for test dataImmutableMap.of()calls withMap.of()DrainNode.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/distributor/DrainNode.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()calls withMap.of()ReverseProxyHandler.java
Replace Guava ImmutableSet with Java Set.ofjava/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java
ImmutableSetimport and unused Logger fieldjava.util.SetimportImmutableSet.builder()pattern withSet.of()for header namesconstant
CheckContentTypeHeader.java
Replace Guava immutable collections with Java built-insjava/src/org/openqa/selenium/grid/web/CheckContentTypeHeader.java
ImmutableMapandImmutableSetimportsjava.util.MapimportImmutableMap.of()calls withMap.of()ImmutableSet.copyOf()withSet.copyOf()NewNodeSession.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/node/NewNodeSession.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()withMap.of()SafariDriverService.java
Simplify immutable collection creation with copyOf methodsjava/src/org/openqa/selenium/safari/SafariDriverService.java
unmodifiableMapimport andArraysimportHashMapimportList.copyOf()andMap.copyOf()instead ofwrapping
createArgs()to useArrayListwith capacity and manualadds, returning
unmodifiableList()ChromiumOptions.java
Replace Arrays.asList with List.ofjava/src/org/openqa/selenium/chromium/ChromiumOptions.java
Arrays.asList()calls withList.of()in methodoverloads
Proxy.java
Replace Arrays.asList with List.ofjava/src/org/openqa/selenium/Proxy.java
java.util.ArraysimportArrays.asList()withList.of()intoJson()methodDescribedOption.java
Replace Guava ImmutableSet with Java Set.copyOfjava/src/org/openqa/selenium/grid/config/DescribedOption.java
ImmutableSetimportImmutableSet.copyOf()withSet.copyOf()StatusHandler.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/node/StatusHandler.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()calls withMap.of()FirefoxDriverTest.java
Replace Guava ImmutableMap and improve resource handlingjava/test/org/openqa/selenium/firefox/FirefoxDriverTest.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()withMap.of()management
TemplateGridServerCommand.java
Replace Arrays.asList with List.ofjava/src/org/openqa/selenium/grid/TemplateGridServerCommand.java
java.util.ArraysimportArrays.asList()withList.of()in route building logicStatusHandler.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/distributor/StatusHandler.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()calls withMap.of()GetNodeSession.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/node/GetNodeSession.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()withMap.of()IsSessionOwner.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/node/IsSessionOwner.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()withMap.of()GetContainerLogs.java
Replace Arrays.asList with List.ofjava/src/org/openqa/selenium/docker/client/GetContainerLogs.java
java.util.ArraysimportArrays.asList()withList.of()for log linesDriverServiceSessionFactory.java
Replace Arrays.asList with List.ofjava/src/org/openqa/selenium/grid/node/config/DriverServiceSessionFactory.java
java.util.ArraysimportArrays.asList()withList.of()for vendor optionscapabilities
EdgeOptionsTest.java
Replace Arrays.asList with List.ofjava/test/org/openqa/selenium/edge/EdgeOptionsTest.java
Arrays.asList()calls withList.of()CheckOriginHeader.java
Replace Guava immutable collections with Java built-insjava/src/org/openqa/selenium/grid/web/CheckOriginHeader.java
ImmutableMapandImmutableSetimportsjava.util.MapimportImmutableSet.copyOf()calls withSet.copyOf()ImmutableMap.of()calls withMap.of()ImageSummary.java
Replace Guava ImmutableSet with Java Set.copyOfjava/src/org/openqa/selenium/docker/internal/ImageSummary.java
ImmutableSetimportImmutableSet.copyOf()withSet.copyOf()EndToEndTest.java
Replace Guava immutable collections with Java built-insjava/test/org/openqa/selenium/grid/router/EndToEndTest.java
ImmutableMapandImmutableSetimportsImmutableSet.of().stream()withStream.of()for test dataImmutableMap.of()calls withMap.of()AddingNodesTest.java
Replace Guava immutable collections with Java built-insjava/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java
ImmutableMapandImmutableSetimportsImmutableSet.of()calls withSet.of()ImmutableMap.copyOf()withMap.copyOf()DefaultHubConfig.java
Replace Guava ImmutableMap with Java Map.ofjava/src/org/openqa/selenium/grid/commands/DefaultHubConfig.java
ImmutableMapimportjava.util.MapimportImmutableMap.of()calls withMap.of()SelectElementTest.java
Replace Arrays.asList with List.ofjava/test/org/openqa/selenium/support/ui/SelectElementTest.java
java.util.ArraysimportArrays.asList()calls withList.of()Hub.java
Replace Guava ImmutableSet with Java Set.ofjava/src/org/openqa/selenium/grid/commands/Hub.java
ImmutableSetimportImmutableSet.of()withSet.of()ingetConfigurableRoles()LocalDistributor.java
Replace Guava ImmutableSet with Java Set.ofjava/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
ImmutableSetimportImmutableSet.of()withSet.of()inisReady()method101 files