2020import static com .google .common .base .Throwables .throwIfUnchecked ;
2121import static java .util .Optional .ofNullable ;
2222
23- import com .google .common .base .Function ;
2423import com .google .common .base .Supplier ;
2524import com .google .common .base .Throwables ;
2625
@@ -49,7 +48,7 @@ private AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, Drive
4948 HttpClient .Factory httpClientFactory ) {
5049 super (additionalCommands ,
5150 ofNullable (service )
52- .map (( Function < DriverService , URL >) DriverService ::getUrl )
51+ .map (DriverService ::getUrl )
5352 .orElse (addressOfRemoteServer ), httpClientFactory );
5453 serviceOptional = ofNullable (service );
5554 }
@@ -58,7 +57,7 @@ public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, Driver
5857 HttpClient .Factory httpClientFactory ) {
5958 this (additionalCommands , checkNotNull (service ), null , httpClientFactory );
6059 }
61-
60+
6261 public AppiumCommandExecutor (Map <String , CommandInfo > additionalCommands ,
6362 URL addressOfRemoteServer , HttpClient .Factory httpClientFactory ) {
6463 this (additionalCommands , null , checkNotNull (addressOfRemoteServer ), httpClientFactory );
@@ -92,7 +91,7 @@ public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands,
9291 Throwable rootCause = Throwables .getRootCause (t );
9392 if (rootCause instanceof ConnectException
9493 && rootCause .getMessage ().contains ("Connection refused" )) {
95- throw serviceOptional .map (( Function < DriverService , WebDriverException >) service -> {
94+ throw serviceOptional .map (service -> {
9695 if (service .isRunning ()) {
9796 return new WebDriverException ("The session is closed!" , rootCause );
9897 }
0 commit comments