Repository: skiptests/astraea
Pull request #380 (2022-05-27 08:01:10)

Refactor Utils.class
完成項目如下：
1. 移除已經沒有在使用的方法
2. rename `handleException` to `packException`
3. 新增 `swallowException`來隱藏例外
4. rename utils package to common package
5. relocate Utils.class to common package
6. replace `Utils.close` by `Utils.packException`


Patch:
diff --git a/app/src/main/java/org/astraea/admin/Builder.java b/app/src/main/java/org/astraea/admin/Builder.java
index 8906b422..cce17579 100644
--- a/app/src/main/java/org/astraea/admin/Builder.java
+++ b/app/src/main/java/org/astraea/admin/Builder.java
@@ -32,7 +32,7 @@ import org.apache.kafka.common.quota.ClientQuotaAlteration;
 import org.apache.kafka.common.quota.ClientQuotaEntity;
 import org.apache.kafka.common.quota.ClientQuotaFilter;
 import org.apache.kafka.common.quota.ClientQuotaFilterComponent;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 
 public class Builder {
 
@@ -69,7 +69,7 @@ public class Builder {
 
     @Override
     public Set<Integer> brokerIds() {
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin.describeCluster().nodes().get().stream()
                   .map(Node::id)
@@ -78,7 +78,7 @@ public class Builder {
 
     @Override
     public Map<Integer, Set<String>> brokerFolders(Set<Integer> brokers) {
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin.describeLogDirs(brokers).allDescriptions().get().entrySet().stream()
                   .collect(Collectors.toMap(Map.Entry::getKey, map -> map.getValue().keySet())));
@@ -92,7 +92,7 @@ public class Builder {
     @Override
     public Map<TopicPartition, Collection<ProducerState>> producerStates(
         Set<TopicPartition> partitions) {
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin
                   .describeProducers(
@@ -115,14 +115,14 @@ public class Builder {
 
     @Override
     public Set<String> consumerGroupIds() {
-      return Utils.handleException(() -> admin.listConsumerGroups().all().get()).stream()
+      return Utils.packException(() -> admin.listConsumerGroups().all().get()).stream()
           .map(ConsumerGroupListing::groupId)
           .collect(Collectors.toUnmodifiableSet());
     }
 
     @Override
     public Map<String, ConsumerGroup> consumerGroups(Set<String> consumerGroupNames) {
-      return Utils.handleException(
+      return Utils.packException(
           () -> {
             var consumerGroupDescriptions =
                 admin.describeConsumerGroups(consumerGroupNames).all().get();
@@ -134,7 +134,7 @@ public class Builder {
                         x ->
                             Map.entry(
                                 x.getKey(),
-                                Utils.handleException(
+                                Utils.packException(
                                     () -> x.getValue().partitionsToOffsetAndMetadata().get())))
                     .collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue));
 
@@ -175,7 +175,7 @@ public class Builder {
 
     private Map<TopicPartition, Long> earliestOffset(Set<TopicPartition> partitions) {
 
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin
                   .listOffsets(
@@ -193,7 +193,7 @@ public class Builder {
     }
 
     private Map<TopicPartition, Long> latestOffset(Set<TopicPartition> partitions) {
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin
                   .listOffsets(
@@ -212,7 +212,7 @@ public class Builder {
 
     @Override
     public Map<String, Config> topics(Set<String> topicNames) {
-      return Utils.handleException(
+      return Utils.packException(
               () ->
                   admin
                       .describeConfigs(
@@ -228,13 +228,13 @@ public class Builder {
 
     @Override
     public Set<String> topicNames() {
-      return Utils.handleException(
+      return Utils.packException(
           () -> admin.listTopics(new ListTopicsOptions().listInternal(true)).names().get());
     }
 
     @Override
     public Map<Integer, Config> brokers(Set<Integer> brokerIds) {
-      return Utils.handleException(
+      return Utils.packException(
               () ->
                   admin
                       .describeConfigs(
@@ -267,7 +267,7 @@ public class Builder {
 
     @Override
     public Set<TopicPartition> partitions(Set<String> topics) {
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin.describeTopics(topics).all().get().entrySet().stream()
                   .flatMap(
@@ -296,7 +296,7 @@ public class Builder {
     @Override
     public Map<TopicPartition, List<Replica>> replicas(Set<String> topics) {
       var replicaInfos =
-          Utils.handleException(() -> admin.describeLogDirs(brokerIds()).allDescriptions().get());
+          Utils.packException(() -> admin.describeLogDirs(brokerIds()).allDescriptions().get());
 
       BiFunction<Integer, TopicPartition, List<Map.Entry<String, ReplicaInfo>>> findReplicas =
           (id, partition) ->
@@ -311,7 +311,7 @@ public class Builder {
                       })
                   .collect(Collectors.toList());
 
-      return Utils.handleException(
+      return Utils.packException(
           () ->
               admin.describeTopics(topics).all().get().entrySet().stream()
                   .flatMap(
@@ -381,7 +381,7 @@ public class Builder {
 
     private Collection<Quota> quotas(ClientQuotaFilter filter) {
       return Quota.of(
-          Utils.handleException(() -> admin.describeClientQuotas(filter).entities().get()));
+          Utils.packException(() -> admin.describeClientQuotas(filter).entities().get()));
     }
   }
 
@@ -470,7 +470,7 @@ public class Builder {
 
     @Override
     public void create() {
-      if (Utils.handleException(() -> admin.listTopics().names().get()).contains(topic)) {
+      if (Utils.packException(() -> admin.listTopics().names().get()).contains(topic)) {
         var partitionReplicas = replicasGetter.apply(topic);
         partitionReplicas.forEach(
             (tp, replicas) -> {
@@ -483,7 +483,7 @@ public class Builder {
                         + numberOfReplicas);
             });
         var result =
-            Utils.handleException(() -> admin.describeTopics(Set.of(topic)).all().get().get(topic));
+            Utils.packException(() -> admin.describeTopics(Set.of(topic)).all().get().get(topic));
         if (result.partitions().size() != numberOfPartitions)
           throw new IllegalArgumentException(
               topic
@@ -512,7 +512,7 @@ public class Builder {
         return;
       }
 
-      Utils.handleException(
+      Utils.packException(
           () ->
               admin
                   .createTopics(
@@ -551,7 +551,7 @@ public class Builder {
 
     @Override
     public void moveTo(Map<Integer, String> brokerFolders) {
-      Utils.handleException(
+      Utils.packException(
           () ->
               admin.alterReplicaLogDirs(
                   brokerFolders.entrySet().stream()
@@ -567,7 +567,7 @@ public class Builder {
 
     @Override
     public void moveTo(List<Integer> brokers) {
-      Utils.handleException(
+      Utils.packException(
           () ->
               admin
                   .alterPartitionReassignments(
@@ -587,7 +587,7 @@ public class Builder {
       moveTo(all);
       // kafka produces error if re-election happens in single node
       if (!followers.isEmpty())
-        Utils.handleException(
+        Utils.packException(
             () ->
                 admin
                     .electLeaders(
@@ -619,7 +619,7 @@ public class Builder {
         @Override
         public void create() {
           if (connectionRate == Integer.MAX_VALUE) return;
-          Utils.handleException(
+          Utils.packException(
               () ->
                   admin
                       .alterClientQuotas(
@@ -666,7 +666,7 @@ public class Builder {
                 new ClientQuotaAlteration.Op(
                     Quota.Limit.CONSUMER_BYTE_RATE.nameOfKafka(), (double) consumeRate));
           if (!q.isEmpty())
-            Utils.handleException(
+            Utils.packException(
                 () ->
                     admin
                         .alterClientQuotas(
diff --git a/app/src/main/java/org/astraea/admin/ReplicaSyncingMonitor.java b/app/src/main/java/org/astraea/admin/ReplicaSyncingMonitor.java
index 91eb18c0..816a861f 100644
--- a/app/src/main/java/org/astraea/admin/ReplicaSyncingMonitor.java
+++ b/app/src/main/java/org/astraea/admin/ReplicaSyncingMonitor.java
@@ -16,12 +16,12 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.kafka.common.TopicPartitionReplica;
-import org.astraea.Utils;
 import org.astraea.argument.DurationField;
 import org.astraea.argument.NonEmptyStringField;
-import org.astraea.utils.DataRate;
-import org.astraea.utils.DataSize;
-import org.astraea.utils.DataUnit;
+import org.astraea.common.DataRate;
+import org.astraea.common.DataSize;
+import org.astraea.common.DataUnit;
+import org.astraea.common.Utils;
 
 public class ReplicaSyncingMonitor {
 
@@ -168,7 +168,7 @@ public class ReplicaSyncingMonitor {
             .forEach(tpr -> previousCheckedSize.remove(tpr.getKey()));
       }
 
-      Utils.handleException(
+      Utils.packException(
           () -> {
             long expectedWaitNs = argument.interval.toNanos();
             long elapsedNs = (System.nanoTime() - startTime);
diff --git a/app/src/main/java/org/astraea/admin/TopicExplorer.java b/app/src/main/java/org/astraea/admin/TopicExplorer.java
index 6020e884..4c3cfb21 100644
--- a/app/src/main/java/org/astraea/admin/TopicExplorer.java
+++ b/app/src/main/java/org/astraea/admin/TopicExplorer.java
@@ -19,8 +19,8 @@ import java.util.stream.IntStream;
 import java.util.stream.Stream;
 import org.astraea.argument.NonEmptyStringField;
 import org.astraea.argument.StringSetField;
-import org.astraea.utils.DataSize;
-import org.astraea.utils.DataUnit;
+import org.astraea.common.DataSize;
+import org.astraea.common.DataUnit;
 
 public class TopicExplorer {
 
diff --git a/app/src/main/java/org/astraea/utils/DataRate.java b/app/src/main/java/org/astraea/common/DataRate.java
similarity index 99%
rename from app/src/main/java/org/astraea/utils/DataRate.java
rename to app/src/main/java/org/astraea/common/DataRate.java
index 94bd315a..40f1e686 100644
--- a/app/src/main/java/org/astraea/utils/DataRate.java
+++ b/app/src/main/java/org/astraea/common/DataRate.java
@@ -1,4 +1,4 @@
-package org.astraea.utils;
+package org.astraea.common;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
diff --git a/app/src/main/java/org/astraea/utils/DataSize.java b/app/src/main/java/org/astraea/common/DataSize.java
similarity index 99%
rename from app/src/main/java/org/astraea/utils/DataSize.java
rename to app/src/main/java/org/astraea/common/DataSize.java
index 98e9f774..f0165df9 100644
--- a/app/src/main/java/org/astraea/utils/DataSize.java
+++ b/app/src/main/java/org/astraea/common/DataSize.java
@@ -1,4 +1,4 @@
-package org.astraea.utils;
+package org.astraea.common;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
diff --git a/app/src/main/java/org/astraea/utils/DataUnit.java b/app/src/main/java/org/astraea/common/DataUnit.java
similarity index 99%
rename from app/src/main/java/org/astraea/utils/DataUnit.java
rename to app/src/main/java/org/astraea/common/DataUnit.java
index 69e2500b..a197d0ae 100644
--- a/app/src/main/java/org/astraea/utils/DataUnit.java
+++ b/app/src/main/java/org/astraea/common/DataUnit.java
@@ -1,4 +1,4 @@
-package org.astraea.utils;
+package org.astraea.common;
 
 import java.math.BigInteger;
 import java.util.Arrays;
diff --git a/app/src/main/java/org/astraea/Utils.java b/app/src/main/java/org/astraea/common/Utils.java
similarity index 57%
rename from app/src/main/java/org/astraea/Utils.java
rename to app/src/main/java/org/astraea/common/Utils.java
index 2bd2c0cd..af9ee34f 100644
--- a/app/src/main/java/org/astraea/Utils.java
+++ b/app/src/main/java/org/astraea/common/Utils.java
@@ -1,17 +1,10 @@
-package org.astraea;
+package org.astraea.common;
 
 import java.io.File;
-import java.io.IOException;
-import java.io.UncheckedIOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
-import java.net.UnknownHostException;
 import java.nio.file.Files;
 import java.time.Duration;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Supplier;
@@ -27,7 +20,15 @@ public final class Utils {
     return current;
   }
 
-  public static <R> R handleException(Getter<R> getter) {
+  /**
+   * Convert the exception thrown by getter to RuntimeException. This method can eliminate the
+   * exception from Java signature.
+   *
+   * @param getter to execute
+   * @param <R> type of returned object
+   * @return the object created by getter
+   */
+  public static <R> R packException(Getter<R> getter) {
     try {
       return getter.get();
     } catch (Throwable exception) {
@@ -38,49 +39,63 @@ public final class Utils {
     }
   }
 
+  /**
+   * Convert the exception thrown by getter to RuntimeException. This method can eliminate the
+   * exception from Java signature.
+   *
+   * @param runner to execute
+   */
+  public static void packException(Runner runner) {
+    Utils.packException(
+        () -> {
+          runner.run();
+          return null;
+        });
+  }
+
+  /**
+   * Swallow any exception caused by runner.
+   *
+   * @param runner to execute
+   */
+  public static void swallowException(Runner runner) {
+    Utils.packException(
+        () -> {
+          runner.run();
+          return null;
+        });
+  }
+
   public interface Getter<R> {
     R get() throws Exception;
   }
 
+  public interface Runner {
+    void run() throws Exception;
+  }
+
   /**
    * Delete the file or folder
    *
    * @param file path to file or folder
    */
   public static void delete(File file) {
-    try {
-      if (file.isDirectory()) {
-        var fs = file.listFiles();
-        if (fs != null) Stream.of(fs).forEach(Utils::delete);
-      }
-      Files.deleteIfExists(file.toPath());
-    } catch (IOException e) {
-      throw new IllegalStateException(e);
-    }
+    Utils.packException(
+        () -> {
+          if (file.isDirectory()) {
+            var fs = file.listFiles();
+            if (fs != null) Stream.of(fs).forEach(Utils::delete);
+          }
+          Files.deleteIfExists(file.toPath());
+        });
   }
 
   public static String hostname() {
-    try {
-      return InetAddress.getLocalHost().getHostName();
-    } catch (UnknownHostException e) {
-      throw new IllegalArgumentException(e);
-    }
+    return Utils.packException(() -> InetAddress.getLocalHost().getHostName());
   }
 
   public static File createTempDirectory(String prefix) {
-    try {
-      return Files.createTempDirectory(prefix).toFile();
-    } catch (IOException e) {
-      throw new UncheckedIOException(e);
-    }
-  }
-
-  public static void close(AutoCloseable closeable) {
-    try {
-      if (closeable != null) closeable.close();
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
+    return Utils.packException(() -> Files.createTempDirectory(prefix).toFile());
   }
 
   /**
@@ -111,39 +126,6 @@ public final class Utils {
     throw new RuntimeException("Timeout to wait procedure");
   }
 
-  /**
-   * Get the field of the object.
-   *
-   * @param object reflected object.
-   * @param fieldName reflected field name.
-   * @return Required field.
-   */
-  public static Object requireField(Object object, String fieldName) {
-    try {
-      var field = object.getClass().getDeclaredField(fieldName);
-      field.setAccessible(true);
-      return field.get(object);
-    } catch (NoSuchFieldException | IllegalAccessException e) {
-      throw new IllegalArgumentException(e);
-    }
-  }
-
-  /**
-   * Separate host and port
-   *
-   * @param address like 0.0.0.0:9092
-   * @return (0.0.0.0,9092)
-   */
-  public static Map<String, Integer> requireHostPort(List<String> address) {
-    var mapAddress = new HashMap<String, Integer>();
-    address.forEach(
-        str ->
-            mapAddress.put(
-                Arrays.asList(str.split(":")).get(0),
-                Integer.parseInt(Arrays.asList(str.split(":")).get(1))));
-    return mapAddress;
-  }
-
   public static int requirePositive(int value) {
     if (value <= 0)
       throw new IllegalArgumentException("the value: " + value + " must be bigger than zero");
@@ -162,10 +144,7 @@ public final class Utils {
   }
 
   public static void sleep(Duration duration) {
-    try {
-      TimeUnit.MILLISECONDS.sleep(duration.toMillis());
-    } catch (InterruptedException ignored) {
-    }
+    Utils.swallowException(() -> TimeUnit.MILLISECONDS.sleep(duration.toMillis()));
   }
 
   public static String randomString(int len) {
@@ -186,14 +165,15 @@ public final class Utils {
   }
 
   public static int availablePort() {
-    try (ServerSocket socket = new ServerSocket(0)) {
-      socket.setReuseAddress(true);
-      var port = socket.getLocalPort();
-      // the port smaller than 1024 may be protected by OS.
-      return port > 1024 ? port : port + 1024;
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    }
+    return Utils.packException(
+        () -> {
+          try (ServerSocket socket = new ServerSocket(0)) {
+            socket.setReuseAddress(true);
+            var port = socket.getLocalPort();
+            // the port smaller than 1024 may be protected by OS.
+            return port > 1024 ? port : port + 1024;
+          }
+        });
   }
 
   public static int resolvePort(int port) {
diff --git a/app/src/main/java/org/astraea/cost/Periodic.java b/app/src/main/java/org/astraea/cost/Periodic.java
index 03814ff8..3ddf331b 100644
--- a/app/src/main/java/org/astraea/cost/Periodic.java
+++ b/app/src/main/java/org/astraea/cost/Periodic.java
@@ -2,7 +2,7 @@ package org.astraea.cost;
 
 import java.time.Duration;
 import java.util.function.Supplier;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 
 /** Enables methods to be updated periodically, not calculated every time they are called. */
 public abstract class Periodic<Value> {
diff --git a/app/src/main/java/org/astraea/database/Builder.java b/app/src/main/java/org/astraea/database/Builder.java
index 24c8f18b..b7ead224 100644
--- a/app/src/main/java/org/astraea/database/Builder.java
+++ b/app/src/main/java/org/astraea/database/Builder.java
@@ -16,7 +16,7 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 
 public class Builder {
   private String url;
@@ -43,7 +43,7 @@ public class Builder {
   public DatabaseClient build() {
     return new DatabaseClient() {
       private final Connection connection =
-          Utils.handleException(
+          Utils.packException(
               () ->
                   DriverManager.getConnection(
                       Objects.requireNonNull(url, "url must be defined"),
@@ -77,7 +77,7 @@ public class Builder {
 
           @Override
           public Collection<TableInfo> run() {
-            return Utils.handleException(
+            return Utils.packException(
                 () -> {
                   var md = connection.getMetaData();
                   return catalogAndNames(md.getTables(catalog, schema, tableName, null)).stream()
@@ -87,11 +87,11 @@ public class Builder {
                             var tableName = e.getValue();
                             var pks =
                                 primaryKeys(
-                                    Utils.handleException(
+                                    Utils.packException(
                                         () -> md.getPrimaryKeys(catalog, null, tableName)));
                             var columnNameAndTypes =
                                 columnNameAndTypes(
-                                    Utils.handleException(
+                                    Utils.packException(
                                         () -> md.getColumns(catalog, null, tableName, null)));
                             return new TableInfo(
                                 tableName,
@@ -159,7 +159,7 @@ public class Builder {
 
       @Override
       public void close() {
-        Utils.close(connection);
+        Utils.packException(connection::close);
       }
 
       private void execute(String sql) {
@@ -205,23 +205,23 @@ public class Builder {
   }
 
   private static String catalog(ResultSet rs) {
-    return Utils.handleException(() -> rs.getString("TABLE_CAT"));
+    return Utils.packException(() -> rs.getString("TABLE_CAT"));
   }
 
   private static String tableName(ResultSet rs) {
-    return Utils.handleException(() -> rs.getString("TABLE_NAME"));
+    return Utils.packException(() -> rs.getString("TABLE_NAME"));
   }
 
   private static String columnName(ResultSet rs) {
-    return Utils.handleException(() -> rs.getString("COLUMN_NAME"));
+    return Utils.packException(() -> rs.getString("COLUMN_NAME"));
   }
 
   private static String columnType(ResultSet rs) {
-    return Utils.handleException(() -> rs.getString("TYPE_NAME"));
+    return Utils.packException(() -> rs.getString("TYPE_NAME"));
   }
 
   private static boolean isNormalTable(ResultSet rs) {
-    return Utils.handleException(
+    return Utils.packException(
         () -> {
           var r = rs.getString("TABLE_TYPE");
           if (r == null) return true;
diff --git a/app/src/main/java/org/astraea/metrics/collector/BeanCollector.java b/app/src/main/java/org/astraea/metrics/collector/BeanCollector.java
index 5a52b83f..1976a96f 100644
--- a/app/src/main/java/org/astraea/metrics/collector/BeanCollector.java
+++ b/app/src/main/java/org/astraea/metrics/collector/BeanCollector.java
@@ -1,6 +1,8 @@
 package org.astraea.metrics.collector;
 
 import java.time.Duration;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -11,7 +13,7 @@ import java.util.concurrent.ConcurrentSkipListMap;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.function.BiFunction;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.metrics.HasBeanObject;
 import org.astraea.metrics.jmx.MBeanClient;
 import org.astraea.metrics.kafka.KafkaMetrics;
@@ -108,9 +110,9 @@ public class BeanCollector {
               }
 
               @Override
-              public List<HasBeanObject> current() {
+              public Collection<HasBeanObject> current() {
                 tryUpdate();
-                return List.copyOf(objects.values());
+                return Collections.unmodifiableCollection(objects.values());
               }
 
               @Override
@@ -118,7 +120,8 @@ public class BeanCollector {
                 node.lock.lock();
                 try {
                   node.receivers.remove(this);
-                  if (node.receivers.isEmpty()) Utils.close(node.mBeanClient);
+                  if (node.receivers.isEmpty() && node.mBeanClient != null)
+                    Utils.swallowException(node.mBeanClient::close);
                   node.mBeanClient = null;
                 } finally {
                   node.lock.unlock();
diff --git a/app/src/main/java/org/astraea/metrics/jmx/MBeanClientImpl.java b/app/src/main/java/org/astraea/metrics/jmx/MBeanClientImpl.java
index 3cbd3253..cf38e66e 100644
--- a/app/src/main/java/org/astraea/metrics/jmx/MBeanClientImpl.java
+++ b/app/src/main/java/org/astraea/metrics/jmx/MBeanClientImpl.java
@@ -22,7 +22,7 @@ import javax.management.ReflectionException;
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 
 class MBeanClientImpl implements MBeanClient {
 
@@ -178,7 +178,7 @@ class MBeanClientImpl implements MBeanClient {
   public void close() {
     if (!isClosed) {
       isClosed = true;
-      Utils.close(jmxConnector);
+      Utils.packException(jmxConnector::close);
     }
   }
 }
diff --git a/app/src/main/java/org/astraea/partitioner/StrictCostDispatcher.java b/app/src/main/java/org/astraea/partitioner/StrictCostDispatcher.java
index 8aa20fc9..9b6b6bc6 100644
--- a/app/src/main/java/org/astraea/partitioner/StrictCostDispatcher.java
+++ b/app/src/main/java/org/astraea/partitioner/StrictCostDispatcher.java
@@ -9,7 +9,7 @@ import java.util.Objects;
 import java.util.Optional;
 import java.util.TreeMap;
 import java.util.stream.Collectors;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.cost.ClusterInfo;
 import org.astraea.cost.CostFunction;
 import org.astraea.cost.HasBrokerCost;
@@ -200,7 +200,7 @@ public class StrictCostDispatcher implements Dispatcher {
 
   @Override
   public void close() {
-    receivers.values().forEach(Utils::close);
+    receivers.values().forEach(r -> Utils.swallowException(r::close));
     receivers.clear();
   }
 }
diff --git a/app/src/main/java/org/astraea/partitioner/smooth/SmoothWeightRoundRobinDispatcher.java b/app/src/main/java/org/astraea/partitioner/smooth/SmoothWeightRoundRobinDispatcher.java
index 201ba3e4..318f9535 100644
--- a/app/src/main/java/org/astraea/partitioner/smooth/SmoothWeightRoundRobinDispatcher.java
+++ b/app/src/main/java/org/astraea/partitioner/smooth/SmoothWeightRoundRobinDispatcher.java
@@ -16,7 +16,7 @@ import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 import org.apache.kafka.common.Cluster;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.cost.ClusterInfo;
 import org.astraea.cost.NodeInfo;
 import org.astraea.cost.Periodic;
@@ -96,7 +96,7 @@ public class SmoothWeightRoundRobinDispatcher extends Periodic<Map<Integer, Doub
 
   @Override
   public void close() {
-    receivers.values().forEach(Utils::close);
+    receivers.values().forEach(r -> Utils.swallowException(r::close));
     receivers.clear();
   }
 
diff --git a/app/src/main/java/org/astraea/performance/DataSupplier.java b/app/src/main/java/org/astraea/performance/DataSupplier.java
index 657949a1..9c6b5538 100644
--- a/app/src/main/java/org/astraea/performance/DataSupplier.java
+++ b/app/src/main/java/org/astraea/performance/DataSupplier.java
@@ -4,8 +4,8 @@ import java.util.Arrays;
 import java.util.Random;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Supplier;
-import org.astraea.utils.DataSize;
-import org.astraea.utils.DataUnit;
+import org.astraea.common.DataSize;
+import org.astraea.common.DataUnit;
 
 @FunctionalInterface
 interface DataSupplier extends Supplier<DataSupplier.Data> {
diff --git a/app/src/main/java/org/astraea/performance/Manager.java b/app/src/main/java/org/astraea/performance/Manager.java
index 25743440..fac125cb 100644
--- a/app/src/main/java/org/astraea/performance/Manager.java
+++ b/app/src/main/java/org/astraea/performance/Manager.java
@@ -2,7 +2,7 @@ package org.astraea.performance;
 
 import java.util.List;
 import java.util.function.Supplier;
-import org.astraea.utils.DataUnit;
+import org.astraea.common.DataUnit;
 
 /**
  * Thread safe This class is used for managing the start/end of the producer/consumer threads.
diff --git a/app/src/main/java/org/astraea/performance/Performance.java b/app/src/main/java/org/astraea/performance/Performance.java
index a3c16afd..adb10730 100644
--- a/app/src/main/java/org/astraea/performance/Performance.java
+++ b/app/src/main/java/org/astraea/performance/Performance.java
@@ -17,7 +17,6 @@ import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import org.apache.kafka.clients.producer.internals.DefaultPartitioner;
 import org.apache.kafka.common.errors.WakeupException;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
 import org.astraea.admin.Compression;
 import org.astraea.admin.TopicPartition;
@@ -27,14 +26,15 @@ import org.astraea.argument.NonNegativeShortField;
 import org.astraea.argument.PathField;
 import org.astraea.argument.PositiveLongField;
 import org.astraea.argument.PositiveShortField;
+import org.astraea.common.DataSize;
+import org.astraea.common.DataUnit;
+import org.astraea.common.Utils;
 import org.astraea.concurrent.Executor;
 import org.astraea.concurrent.State;
 import org.astraea.concurrent.ThreadPool;
 import org.astraea.consumer.Consumer;
 import org.astraea.consumer.Isolation;
 import org.astraea.producer.Producer;
-import org.astraea.utils.DataSize;
-import org.astraea.utils.DataUnit;
 
 /**
  * Performance benchmark which includes
diff --git a/app/src/main/java/org/astraea/performance/ProducerExecutor.java b/app/src/main/java/org/astraea/performance/ProducerExecutor.java
index 12c8f42c..a248c22d 100644
--- a/app/src/main/java/org/astraea/performance/ProducerExecutor.java
+++ b/app/src/main/java/org/astraea/performance/ProducerExecutor.java
@@ -7,7 +7,7 @@ import java.util.function.BiConsumer;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.concurrent.Executor;
 import org.astraea.concurrent.State;
 import org.astraea.producer.Producer;
diff --git a/app/src/main/java/org/astraea/performance/ReportFormat.java b/app/src/main/java/org/astraea/performance/ReportFormat.java
index 98c452b4..7a0b6200 100644
--- a/app/src/main/java/org/astraea/performance/ReportFormat.java
+++ b/app/src/main/java/org/astraea/performance/ReportFormat.java
@@ -12,10 +12,10 @@ import java.time.Duration;
 import java.util.Date;
 import java.util.function.Supplier;
 import java.util.stream.IntStream;
-import org.astraea.Utils;
+import org.astraea.common.DataUnit;
+import org.astraea.common.Utils;
 import org.astraea.concurrent.Executor;
 import org.astraea.concurrent.State;
-import org.astraea.utils.DataUnit;
 
 public enum ReportFormat {
   CSV("csv"),
@@ -70,7 +70,7 @@ public enum ReportFormat {
 
           @Override
           public void close() {
-            Utils.close(writer);
+            Utils.packException(writer::close);
           }
         };
       case JSON:
@@ -85,11 +85,8 @@ public enum ReportFormat {
 
           @Override
           public void close() {
-            try {
-              writer.write("}");
-              Utils.close(writer);
-            } catch (IOException ignore) {
-            }
+            Utils.swallowException(() -> writer.write("}"));
+            Utils.packException(writer::close);
           }
         };
       default:
diff --git a/app/src/main/java/org/astraea/performance/Tracker.java b/app/src/main/java/org/astraea/performance/Tracker.java
index 229df870..1c968a1d 100644
--- a/app/src/main/java/org/astraea/performance/Tracker.java
+++ b/app/src/main/java/org/astraea/performance/Tracker.java
@@ -5,9 +5,9 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Supplier;
+import org.astraea.common.DataUnit;
 import org.astraea.concurrent.Executor;
 import org.astraea.concurrent.State;
-import org.astraea.utils.DataUnit;
 
 /** Print out the given metrics. */
 public class Tracker implements Executor {


Test patch:
diff --git a/app/src/test/java/org/astraea/admin/AdminTest.java b/app/src/test/java/org/astraea/admin/AdminTest.java
index cfef8718..6fc39611 100644
--- a/app/src/test/java/org/astraea/admin/AdminTest.java
+++ b/app/src/test/java/org/astraea/admin/AdminTest.java
@@ -13,7 +13,7 @@ import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.StreamSupport;
 import org.apache.kafka.common.config.TopicConfig;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.consumer.Consumer;
 import org.astraea.consumer.Deserializer;
 import org.astraea.producer.Producer;
diff --git a/app/src/test/java/org/astraea/admin/ReplicaCollieTest.java b/app/src/test/java/org/astraea/admin/ReplicaCollieTest.java
index 28aadf35..ac946b17 100644
--- a/app/src/test/java/org/astraea/admin/ReplicaCollieTest.java
+++ b/app/src/test/java/org/astraea/admin/ReplicaCollieTest.java
@@ -8,8 +8,8 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
-import org.astraea.Utils;
 import org.astraea.argument.Argument;
+import org.astraea.common.Utils;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
diff --git a/app/src/test/java/org/astraea/admin/ReplicaSyncingMonitorTest.java b/app/src/test/java/org/astraea/admin/ReplicaSyncingMonitorTest.java
index e23f0b7e..4c78d46b 100644
--- a/app/src/test/java/org/astraea/admin/ReplicaSyncingMonitorTest.java
+++ b/app/src/test/java/org/astraea/admin/ReplicaSyncingMonitorTest.java
@@ -28,7 +28,7 @@ import java.util.function.BiFunction;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
-import org.astraea.utils.DataUnit;
+import org.astraea.common.DataUnit;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
diff --git a/app/src/test/java/org/astraea/utils/DataRateTest.java b/app/src/test/java/org/astraea/common/DataRateTest.java
similarity index 99%
rename from app/src/test/java/org/astraea/utils/DataRateTest.java
rename to app/src/test/java/org/astraea/common/DataRateTest.java
index 7f674a37..050dd571 100644
--- a/app/src/test/java/org/astraea/utils/DataRateTest.java
+++ b/app/src/test/java/org/astraea/common/DataRateTest.java
@@ -1,4 +1,4 @@
-package org.astraea.utils;
+package org.astraea.common;
 
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
diff --git a/app/src/test/java/org/astraea/utils/DataSizeTest.java b/app/src/test/java/org/astraea/common/DataSizeTest.java
similarity index 99%
rename from app/src/test/java/org/astraea/utils/DataSizeTest.java
rename to app/src/test/java/org/astraea/common/DataSizeTest.java
index 7ee141c2..4e18039f 100644
--- a/app/src/test/java/org/astraea/utils/DataSizeTest.java
+++ b/app/src/test/java/org/astraea/common/DataSizeTest.java
@@ -1,4 +1,4 @@
-package org.astraea.utils;
+package org.astraea.common;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/app/src/test/java/org/astraea/UtilsTest.java b/app/src/test/java/org/astraea/common/UtilsTest.java
similarity index 86%
rename from app/src/test/java/org/astraea/UtilsTest.java
rename to app/src/test/java/org/astraea/common/UtilsTest.java
index 57ef6415..5d71837b 100644
--- a/app/src/test/java/org/astraea/UtilsTest.java
+++ b/app/src/test/java/org/astraea/common/UtilsTest.java
@@ -1,4 +1,4 @@
-package org.astraea;
+package org.astraea.common;
 
 import java.io.IOException;
 import java.util.concurrent.ExecutionException;
@@ -12,7 +12,7 @@ public class UtilsTest {
     Assertions.assertThrows(
         IllegalArgumentException.class,
         () ->
-            Utils.handleException(
+            Utils.packException(
                 () -> {
                   throw new ExecutionException(new IllegalArgumentException());
                 }));
@@ -20,7 +20,7 @@ public class UtilsTest {
     Assertions.assertThrows(
         IllegalArgumentException.class,
         () ->
-            Utils.handleException(
+            Utils.packException(
                 () -> {
                   throw new IllegalArgumentException();
                 }));
@@ -28,7 +28,7 @@ public class UtilsTest {
     Assertions.assertThrows(
         RuntimeException.class,
         () ->
-            Utils.handleException(
+            Utils.packException(
                 () -> {
                   throw new IOException();
                 }));
diff --git a/app/src/test/java/org/astraea/consumer/ConsumerTest.java b/app/src/test/java/org/astraea/consumer/ConsumerTest.java
index 7f99c882..77055b39 100644
--- a/app/src/test/java/org/astraea/consumer/ConsumerTest.java
+++ b/app/src/test/java/org/astraea/consumer/ConsumerTest.java
@@ -7,7 +7,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.IntStream;
 import org.apache.kafka.common.errors.WakeupException;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.producer.Producer;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
diff --git a/app/src/test/java/org/astraea/consumer/RebalanceListenerTest.java b/app/src/test/java/org/astraea/consumer/RebalanceListenerTest.java
index 8cf6ac55..49d92866 100644
--- a/app/src/test/java/org/astraea/consumer/RebalanceListenerTest.java
+++ b/app/src/test/java/org/astraea/consumer/RebalanceListenerTest.java
@@ -3,7 +3,7 @@ package org.astraea.consumer;
 import java.time.Duration;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.concurrent.State;
 import org.astraea.concurrent.ThreadPool;
 import org.astraea.service.RequireBrokerCluster;
diff --git a/app/src/test/java/org/astraea/database/DatabaseClientTest.java b/app/src/test/java/org/astraea/database/DatabaseClientTest.java
index a952aa02..8c61e96e 100644
--- a/app/src/test/java/org/astraea/database/DatabaseClientTest.java
+++ b/app/src/test/java/org/astraea/database/DatabaseClientTest.java
@@ -1,6 +1,6 @@
 package org.astraea.database;
 
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.service.Database;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
diff --git a/app/src/test/java/org/astraea/performance/DataSupplierTest.java b/app/src/test/java/org/astraea/performance/DataSupplierTest.java
index 4d96f2b3..ee0707b7 100644
--- a/app/src/test/java/org/astraea/performance/DataSupplierTest.java
+++ b/app/src/test/java/org/astraea/performance/DataSupplierTest.java
@@ -1,7 +1,7 @@
 package org.astraea.performance;
 
 import java.util.concurrent.TimeUnit;
-import org.astraea.utils.DataUnit;
+import org.astraea.common.DataUnit;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
diff --git a/app/src/test/java/org/astraea/performance/ProducerExecutorTest.java b/app/src/test/java/org/astraea/performance/ProducerExecutorTest.java
index 20c42941..02a1bf0f 100644
--- a/app/src/test/java/org/astraea/performance/ProducerExecutorTest.java
+++ b/app/src/test/java/org/astraea/performance/ProducerExecutorTest.java
@@ -8,9 +8,9 @@ import java.util.concurrent.TimeUnit;
 import java.util.function.BiConsumer;
 import java.util.function.Supplier;
 import java.util.stream.Stream;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
 import org.astraea.admin.TopicPartition;
+import org.astraea.common.Utils;
 import org.astraea.concurrent.State;
 import org.astraea.producer.Producer;
 import org.astraea.service.RequireBrokerCluster;
diff --git a/app/src/test/java/org/astraea/producer/ProducerTest.java b/app/src/test/java/org/astraea/producer/ProducerTest.java
index c444da59..813136d6 100644
--- a/app/src/test/java/org/astraea/producer/ProducerTest.java
+++ b/app/src/test/java/org/astraea/producer/ProducerTest.java
@@ -9,7 +9,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.astraea.consumer.Consumer;
 import org.astraea.consumer.Deserializer;
 import org.astraea.consumer.Header;
diff --git a/app/src/test/java/org/astraea/service/Database.java b/app/src/test/java/org/astraea/service/Database.java
index bdc9e014..b1078bf1 100644
--- a/app/src/test/java/org/astraea/service/Database.java
+++ b/app/src/test/java/org/astraea/service/Database.java
@@ -10,7 +10,7 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.util.Calendar;
 import java.util.concurrent.TimeUnit;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 
 public interface Database extends Closeable {
   static Database mysql() {
diff --git a/app/src/test/java/org/astraea/service/DatabaseTest.java b/app/src/test/java/org/astraea/service/DatabaseTest.java
index ef0a0ff3..6c9c3f6c 100644
--- a/app/src/test/java/org/astraea/service/DatabaseTest.java
+++ b/app/src/test/java/org/astraea/service/DatabaseTest.java
@@ -1,6 +1,6 @@
 package org.astraea.service;
 
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
diff --git a/app/src/test/java/org/astraea/service/RequireBrokerCluster.java b/app/src/test/java/org/astraea/service/RequireBrokerCluster.java
index b278d59f..82b3c83c 100644
--- a/app/src/test/java/org/astraea/service/RequireBrokerCluster.java
+++ b/app/src/test/java/org/astraea/service/RequireBrokerCluster.java
@@ -2,7 +2,7 @@ package org.astraea.service;
 
 import java.util.Map;
 import java.util.Set;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.junit.jupiter.api.AfterAll;
 
 /**
@@ -27,7 +27,7 @@ public abstract class RequireBrokerCluster extends RequireJmxServer {
 
   @AfterAll
   static void shutdownClusters() {
-    Utils.close(BROKER_CLUSTER);
-    Utils.close(ZOOKEEPER_CLUSTER);
+    Utils.swallowException(BROKER_CLUSTER::close);
+    Utils.swallowException(ZOOKEEPER_CLUSTER::close);
   }
 }
diff --git a/app/src/test/java/org/astraea/service/RequireJmxServer.java b/app/src/test/java/org/astraea/service/RequireJmxServer.java
index f591cfc9..5bd35248 100644
--- a/app/src/test/java/org/astraea/service/RequireJmxServer.java
+++ b/app/src/test/java/org/astraea/service/RequireJmxServer.java
@@ -10,7 +10,7 @@ import java.rmi.registry.LocateRegistry;
 import javax.management.remote.JMXConnectorServer;
 import javax.management.remote.JMXConnectorServerFactory;
 import javax.management.remote.JMXServiceURL;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 import org.junit.jupiter.api.AfterAll;
 
 public abstract class RequireJmxServer {
@@ -23,7 +23,7 @@ public abstract class RequireJmxServer {
 
   @AfterAll
   static void shutdownJmxServer() {
-    Utils.close(JMX_CONNECTOR_SERVER::stop);
+    Utils.packException(JMX_CONNECTOR_SERVER::stop);
   }
 
   /**
diff --git a/app/src/test/java/org/astraea/service/Services.java b/app/src/test/java/org/astraea/service/Services.java
index 1031d118..de300478 100644
--- a/app/src/test/java/org/astraea/service/Services.java
+++ b/app/src/test/java/org/astraea/service/Services.java
@@ -15,7 +15,7 @@ import org.apache.kafka.common.network.ListenerName;
 import org.apache.kafka.common.utils.SystemTime;
 import org.apache.zookeeper.server.NIOServerCnxnFactory;
 import org.apache.zookeeper.server.ZooKeeperServer;
-import org.astraea.Utils;
+import org.astraea.common.Utils;
 
 public final class Services {
 
diff --git a/app/src/test/java/org/astraea/web/BrokerHandlerTest.java b/app/src/test/java/org/astraea/web/BrokerHandlerTest.java
index 155978c5..2d4a0035 100644
--- a/app/src/test/java/org/astraea/web/BrokerHandlerTest.java
+++ b/app/src/test/java/org/astraea/web/BrokerHandlerTest.java
@@ -5,8 +5,8 @@ import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
+import org.astraea.common.Utils;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
diff --git a/app/src/test/java/org/astraea/web/GroupHandlerTest.java b/app/src/test/java/org/astraea/web/GroupHandlerTest.java
index 4e442290..af667ef8 100644
--- a/app/src/test/java/org/astraea/web/GroupHandlerTest.java
+++ b/app/src/test/java/org/astraea/web/GroupHandlerTest.java
@@ -6,8 +6,8 @@ import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
+import org.astraea.common.Utils;
 import org.astraea.consumer.Consumer;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
diff --git a/app/src/test/java/org/astraea/web/PipelineHandlerTest.java b/app/src/test/java/org/astraea/web/PipelineHandlerTest.java
index c181d6ed..7caa9223 100644
--- a/app/src/test/java/org/astraea/web/PipelineHandlerTest.java
+++ b/app/src/test/java/org/astraea/web/PipelineHandlerTest.java
@@ -4,8 +4,8 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
+import org.astraea.common.Utils;
 import org.astraea.producer.Producer;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
diff --git a/app/src/test/java/org/astraea/web/ProducerHandlerTest.java b/app/src/test/java/org/astraea/web/ProducerHandlerTest.java
index 1f27e98a..11f96509 100644
--- a/app/src/test/java/org/astraea/web/ProducerHandlerTest.java
+++ b/app/src/test/java/org/astraea/web/ProducerHandlerTest.java
@@ -6,8 +6,8 @@ import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
+import org.astraea.common.Utils;
 import org.astraea.producer.Producer;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
diff --git a/app/src/test/java/org/astraea/web/TopicHandlerTest.java b/app/src/test/java/org/astraea/web/TopicHandlerTest.java
index f5af95fb..96cb70dc 100644
--- a/app/src/test/java/org/astraea/web/TopicHandlerTest.java
+++ b/app/src/test/java/org/astraea/web/TopicHandlerTest.java
@@ -5,8 +5,8 @@ import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import org.astraea.Utils;
 import org.astraea.admin.Admin;
+import org.astraea.common.Utils;
 import org.astraea.service.RequireBrokerCluster;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;