Merge "Use isNullOrEmpty, JUnit4.RunWith, and remove toString"
diff --git a/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java b/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java
index 2920afe..40cb02a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java
@@ -13,6 +13,8 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.automerger;
 
+import static com.google.common.base.Strings.isNullOrEmpty;
+
 import com.google.common.base.Joiner;
 import com.google.gerrit.extensions.api.GerritApi;
 import com.google.gerrit.extensions.api.changes.AbandonInput;
@@ -428,8 +430,8 @@
   }
 
   public String getOrSetTopic(int sourceId, String topic) throws RestApiException {
-    if (topic == null || topic.isEmpty()) {
-      topic = "am-" + UUID.randomUUID().toString();
+    if (isNullOrEmpty(topic)) {
+      topic = "am-" + UUID.randomUUID();
       log.debug("Setting original change {} topic to {}", sourceId, topic);
       gApi.changes().id(sourceId).topic(topic);
     }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/automerger/FailedMergeExceptionTest.java b/src/test/java/com/googlesource/gerrit/plugins/automerger/FailedMergeExceptionTest.java
index 58b2fb9..f7c0cdc 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/automerger/FailedMergeExceptionTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/automerger/FailedMergeExceptionTest.java
@@ -14,13 +14,16 @@
 
 package com.googlesource.gerrit.plugins.automerger;
 
-import java.util.TreeMap;
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-
 import static com.google.common.truth.Truth.assertThat;
 
+import java.util.Map;
+import java.util.TreeMap;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
 public class FailedMergeExceptionTest {
   private Map<String, String> failedMergeBranches;
   private String currentRevision;