Repository: provectus/kafka-ui
Issue: Get rid of UtilityClass annotation usage
Labels: scope/backend
type/refactoring
status/accepted

<img width="789" alt="image" src="https://user-images.githubusercontent.com/1494347/229412156-9aa71568-30af-4585-b181-04f149b2188a.png">


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/Oddrn.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/Oddrn.java
index d228843b21b..00b29b3b8b4 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/Oddrn.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/Oddrn.java
@@ -4,36 +4,34 @@
 import java.net.URI;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import lombok.experimental.UtilityClass;
-import org.opendatadiscovery.oddrn.Generator;
 import org.opendatadiscovery.oddrn.model.AwsS3Path;
 import org.opendatadiscovery.oddrn.model.KafkaConnectorPath;
 import org.opendatadiscovery.oddrn.model.KafkaPath;
 
-@UtilityClass
-public class Oddrn {
+public final class Oddrn {
 
-  private static final Generator GENERATOR = new Generator();
+  private Oddrn() {
+  }
 
-  String clusterOddrn(KafkaCluster cluster) {
+  static String clusterOddrn(KafkaCluster cluster) {
     return KafkaPath.builder()
         .cluster(bootstrapServersForOddrn(cluster.getBootstrapServers()))
         .build()
         .oddrn();
   }
 
-  KafkaPath topicOddrnPath(KafkaCluster cluster, String topic) {
+  static KafkaPath topicOddrnPath(KafkaCluster cluster, String topic) {
     return KafkaPath.builder()
         .cluster(bootstrapServersForOddrn(cluster.getBootstrapServers()))
         .topic(topic)
         .build();
   }
 
-  String topicOddrn(KafkaCluster cluster, String topic) {
+  static String topicOddrn(KafkaCluster cluster, String topic) {
     return topicOddrnPath(cluster, topic).oddrn();
   }
 
-  String awsS3Oddrn(String bucket, String key) {
+  static String awsS3Oddrn(String bucket, String key) {
     return AwsS3Path.builder()
         .bucket(bucket)
         .key(key)
@@ -41,14 +39,14 @@ String awsS3Oddrn(String bucket, String key) {
         .oddrn();
   }
 
-  String connectDataSourceOddrn(String connectUrl) {
+  static String connectDataSourceOddrn(String connectUrl) {
     return KafkaConnectorPath.builder()
         .host(normalizedConnectHosts(connectUrl))
         .build()
         .oddrn();
   }
 
-  private String normalizedConnectHosts(String connectUrlStr) {
+  private static String normalizedConnectHosts(String connectUrlStr) {
     return Stream.of(connectUrlStr.split(","))
         .map(String::trim)
         .sorted()
@@ -61,7 +59,7 @@ private String normalizedConnectHosts(String connectUrlStr) {
         .collect(Collectors.joining(","));
   }
 
-  String connectorOddrn(String connectUrl, String connectorName) {
+  static String connectorOddrn(String connectUrl, String connectorName) {
     return KafkaConnectorPath.builder()
         .host(normalizedConnectHosts(connectUrl))
         .connector(connectorName)
@@ -69,7 +67,7 @@ String connectorOddrn(String connectUrl, String connectorName) {
         .oddrn();
   }
 
-  private String bootstrapServersForOddrn(String bootstrapServers) {
+  private static String bootstrapServersForOddrn(String bootstrapServers) {
     return Stream.of(bootstrapServers.split(","))
         .map(String::trim)
         .sorted()
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/AvroExtractor.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/AvroExtractor.java
index 538bbde1a8a..cc799a9e109 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/AvroExtractor.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/AvroExtractor.java
@@ -1,18 +1,18 @@
 package com.provectus.kafka.ui.service.integration.odd.schema;
 
 import com.google.common.collect.ImmutableSet;
-import com.provectus.kafka.ui.service.integration.odd.Oddrn;
 import com.provectus.kafka.ui.sr.model.SchemaSubject;
 import java.util.ArrayList;
 import java.util.List;
-import lombok.experimental.UtilityClass;
 import org.apache.avro.Schema;
 import org.opendatadiscovery.client.model.DataSetField;
 import org.opendatadiscovery.client.model.DataSetFieldType;
 import org.opendatadiscovery.oddrn.model.KafkaPath;
 
-@UtilityClass
-class AvroExtractor {
+final class AvroExtractor {
+
+  private AvroExtractor() {
+  }
 
   static List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean isKey) {
     var schema = new Schema.Parser().parse(subject.getSchema());
@@ -31,14 +31,14 @@ static List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, b
     return result;
   }
 
-  private void extract(Schema schema,
-                       String parentOddr,
-                       String oddrn, //null for root
-                       String name,
-                       String doc,
-                       Boolean nullable,
-                       ImmutableSet<String> registeredRecords,
-                       List<DataSetField> sink
+  private static void extract(Schema schema,
+                              String parentOddr,
+                              String oddrn, //null for root
+                              String name,
+                              String doc,
+                              Boolean nullable,
+                              ImmutableSet<String> registeredRecords,
+                              List<DataSetField> sink
   ) {
     switch (schema.getType()) {
       case RECORD -> extractRecord(schema, parentOddr, oddrn, name, doc, nullable, registeredRecords, sink);
@@ -49,12 +49,12 @@ private void extract(Schema schema,
     }
   }
 
-  private DataSetField createDataSetField(String name,
-                                          String doc,
-                                          String parentOddrn,
-                                          String oddrn,
-                                          Schema schema,
-                                          Boolean nullable) {
+  private static DataSetField createDataSetField(String name,
+                                                 String doc,
+                                                 String parentOddrn,
+                                                 String oddrn,
+                                                 Schema schema,
+                                                 Boolean nullable) {
     return new DataSetField()
         .name(name)
         .description(doc)
@@ -63,14 +63,14 @@ private DataSetField createDataSetField(String name,
         .type(mapSchema(schema, nullable));
   }
 
-  private void extractRecord(Schema schema,
-                             String parentOddr,
-                             String oddrn, //null for root
-                             String name,
-                             String doc,
-                             Boolean nullable,
-                             ImmutableSet<String> registeredRecords,
-                             List<DataSetField> sink) {
+  private static void extractRecord(Schema schema,
+                                    String parentOddr,
+                                    String oddrn, //null for root
+                                    String name,
+                                    String doc,
+                                    Boolean nullable,
+                                    ImmutableSet<String> registeredRecords,
+                                    List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     if (!isRoot) {
       sink.add(createDataSetField(name, doc, parentOddr, oddrn, schema, nullable));
@@ -99,13 +99,13 @@ private void extractRecord(Schema schema,
         ));
   }
 
-  private void extractUnion(Schema schema,
-                            String parentOddr,
-                            String oddrn, //null for root
-                            String name,
-                            String doc,
-                            ImmutableSet<String> registeredRecords,
-                            List<DataSetField> sink) {
+  private static void extractUnion(Schema schema,
+                                   String parentOddr,
+                                   String oddrn, //null for root
+                                   String name,
+                                   String doc,
+                                   ImmutableSet<String> registeredRecords,
+                                   List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     boolean containsNull = schema.getTypes().stream().map(Schema::getType).anyMatch(t -> t == Schema.Type.NULL);
     // if it is not root and there is only 2 values for union (null and smth else)
@@ -149,14 +149,14 @@ private void extractUnion(Schema schema,
     }
   }
 
-  private void extractArray(Schema schema,
-                            String parentOddr,
-                            String oddrn, //null for root
-                            String name,
-                            String doc,
-                            Boolean nullable,
-                            ImmutableSet<String> registeredRecords,
-                            List<DataSetField> sink) {
+  private static void extractArray(Schema schema,
+                                   String parentOddr,
+                                   String oddrn, //null for root
+                                   String name,
+                                   String doc,
+                                   Boolean nullable,
+                                   ImmutableSet<String> registeredRecords,
+                                   List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     oddrn = isRoot ? parentOddr + "/array" : oddrn;
     if (isRoot) {
@@ -176,14 +176,14 @@ private void extractArray(Schema schema,
     );
   }
 
-  private void extractMap(Schema schema,
-                          String parentOddr,
-                          String oddrn, //null for root
-                          String name,
-                          String doc,
-                          Boolean nullable,
-                          ImmutableSet<String> registeredRecords,
-                          List<DataSetField> sink) {
+  private static void extractMap(Schema schema,
+                                 String parentOddr,
+                                 String oddrn, //null for root
+                                 String name,
+                                 String doc,
+                                 Boolean nullable,
+                                 ImmutableSet<String> registeredRecords,
+                                 List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     oddrn = isRoot ? parentOddr + "/map" : oddrn;
     if (isRoot) {
@@ -214,13 +214,13 @@ private void extractMap(Schema schema,
   }
 
 
-  private void extractPrimitive(Schema schema,
-                                String parentOddr,
-                                String oddrn, //null for root
-                                String name,
-                                String doc,
-                                Boolean nullable,
-                                List<DataSetField> sink) {
+  private static void extractPrimitive(Schema schema,
+                                       String parentOddr,
+                                       String oddrn, //null for root
+                                       String name,
+                                       String doc,
+                                       Boolean nullable,
+                                       List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     String primOddrn = isRoot ? (parentOddr + "/" + schema.getType()) : oddrn;
     if (isRoot) {
@@ -231,7 +231,7 @@ private void extractPrimitive(Schema schema,
     }
   }
 
-  private DataSetFieldType.TypeEnum mapType(Schema.Type type) {
+  private static DataSetFieldType.TypeEnum mapType(Schema.Type type) {
     return switch (type) {
       case INT, LONG -> DataSetFieldType.TypeEnum.INTEGER;
       case FLOAT, DOUBLE, FIXED -> DataSetFieldType.TypeEnum.NUMBER;
@@ -246,14 +246,14 @@ private DataSetFieldType.TypeEnum mapType(Schema.Type type) {
     };
   }
 
-  private DataSetFieldType mapSchema(Schema schema, Boolean nullable) {
+  private static DataSetFieldType mapSchema(Schema schema, Boolean nullable) {
     return new DataSetFieldType()
         .logicalType(logicalType(schema))
         .isNullable(nullable)
         .type(mapType(schema.getType()));
   }
 
-  private String logicalType(Schema schema) {
+  private static String logicalType(Schema schema) {
     return schema.getType() == Schema.Type.RECORD
         ? schema.getFullName()
         : schema.getType().toString().toLowerCase();
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/DataSetFieldsExtractors.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/DataSetFieldsExtractors.java
index 746f172b57f..e357db30793 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/DataSetFieldsExtractors.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/DataSetFieldsExtractors.java
@@ -1,19 +1,16 @@
 package com.provectus.kafka.ui.service.integration.odd.schema;
 
-import com.provectus.kafka.ui.service.integration.odd.Oddrn;
 import com.provectus.kafka.ui.sr.model.SchemaSubject;
 import com.provectus.kafka.ui.sr.model.SchemaType;
 import java.util.List;
 import java.util.Optional;
-import lombok.experimental.UtilityClass;
 import org.opendatadiscovery.client.model.DataSetField;
 import org.opendatadiscovery.client.model.DataSetFieldType;
 import org.opendatadiscovery.oddrn.model.KafkaPath;
 
-@UtilityClass
-public class DataSetFieldsExtractors {
+public final class DataSetFieldsExtractors {
 
-  public List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean isKey) {
+  public static List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean isKey) {
     SchemaType schemaType = Optional.ofNullable(subject.getSchemaType()).orElse(SchemaType.AVRO);
     return switch (schemaType) {
       case AVRO -> AvroExtractor.extract(subject, topicOddrn, isKey);
@@ -23,7 +20,7 @@ public List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, b
   }
 
 
-  DataSetField rootField(KafkaPath topicOddrn, boolean isKey) {
+  static DataSetField rootField(KafkaPath topicOddrn, boolean isKey) {
     var rootOddrn = topicOddrn.oddrn() + "/columns/" + (isKey ? "key" : "value");
     return new DataSetField()
         .name(isKey ? "key" : "value")
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/JsonSchemaExtractor.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/JsonSchemaExtractor.java
index f92e1fc876b..06201b1ce7f 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/JsonSchemaExtractor.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/JsonSchemaExtractor.java
@@ -1,7 +1,6 @@
 package com.provectus.kafka.ui.service.integration.odd.schema;
 
 import com.google.common.collect.ImmutableSet;
-import com.provectus.kafka.ui.service.integration.odd.Oddrn;
 import com.provectus.kafka.ui.sr.model.SchemaSubject;
 import io.confluent.kafka.schemaregistry.json.JsonSchema;
 import java.net.URI;
@@ -10,7 +9,6 @@
 import java.util.Map;
 import java.util.Optional;
 import javax.annotation.Nullable;
-import lombok.experimental.UtilityClass;
 import org.everit.json.schema.ArraySchema;
 import org.everit.json.schema.BooleanSchema;
 import org.everit.json.schema.CombinedSchema;
@@ -27,8 +25,10 @@
 import org.opendatadiscovery.client.model.MetadataExtension;
 import org.opendatadiscovery.oddrn.model.KafkaPath;
 
-@UtilityClass
-class JsonSchemaExtractor {
+final class JsonSchemaExtractor {
+
+  private JsonSchemaExtractor() {
+  }
 
   static List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean isKey) {
     Schema schema = new JsonSchema(subject.getSchema()).rawSchema();
@@ -46,13 +46,13 @@ static List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, b
     return result;
   }
 
-  private void extract(Schema schema,
-                       String parentOddr,
-                       String oddrn, //null for root
-                       String name,
-                       Boolean nullable,
-                       ImmutableSet<String> registeredRecords,
-                       List<DataSetField> sink) {
+  private static void extract(Schema schema,
+                              String parentOddr,
+                              String oddrn, //null for root
+                              String name,
+                              Boolean nullable,
+                              ImmutableSet<String> registeredRecords,
+                              List<DataSetField> sink) {
     if (schema instanceof ReferenceSchema s) {
       Optional.ofNullable(s.getReferredSchema())
           .ifPresent(refSchema -> extract(refSchema, parentOddr, oddrn, name, nullable, registeredRecords, sink));
@@ -73,12 +73,12 @@ private void extract(Schema schema,
     }
   }
 
-  private void extractPrimitive(Schema schema,
-                                String parentOddr,
-                                String oddrn, //null for root
-                                String name,
-                                Boolean nullable,
-                                List<DataSetField> sink) {
+  private static void extractPrimitive(Schema schema,
+                                       String parentOddr,
+                                       String oddrn, //null for root
+                                       String name,
+                                       Boolean nullable,
+                                       List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     sink.add(
         createDataSetField(
@@ -93,12 +93,12 @@ private void extractPrimitive(Schema schema,
     );
   }
 
-  private void extractUnknown(Schema schema,
-                              String parentOddr,
-                              String oddrn, //null for root
-                              String name,
-                              Boolean nullable,
-                              List<DataSetField> sink) {
+  private static void extractUnknown(Schema schema,
+                                     String parentOddr,
+                                     String oddrn, //null for root
+                                     String name,
+                                     Boolean nullable,
+                                     List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     sink.add(
         createDataSetField(
@@ -113,13 +113,13 @@ private void extractUnknown(Schema schema,
     );
   }
 
-  private void extractObject(ObjectSchema schema,
-                             String parentOddr,
-                             String oddrn, //null for root
-                             String name,
-                             Boolean nullable,
-                             ImmutableSet<String> registeredRecords,
-                             List<DataSetField> sink) {
+  private static void extractObject(ObjectSchema schema,
+                                    String parentOddr,
+                                    String oddrn, //null for root
+                                    String name,
+                                    Boolean nullable,
+                                    ImmutableSet<String> registeredRecords,
+                                    List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     // schemaLocation can be null for empty object schemas (like if it used in anyOf)
     @Nullable var schemaLocation = schema.getSchemaLocation();
@@ -162,13 +162,13 @@ private void extractObject(ObjectSchema schema,
     });
   }
 
-  private void extractArray(ArraySchema schema,
-                            String parentOddr,
-                            String oddrn, //null for root
-                            String name,
-                            Boolean nullable,
-                            ImmutableSet<String> registeredRecords,
-                            List<DataSetField> sink) {
+  private static void extractArray(ArraySchema schema,
+                                   String parentOddr,
+                                   String oddrn, //null for root
+                                   String name,
+                                   Boolean nullable,
+                                   ImmutableSet<String> registeredRecords,
+                                   List<DataSetField> sink) {
     boolean isRoot = oddrn == null;
     oddrn = isRoot ? parentOddr + "/array" : oddrn;
     if (isRoot) {
@@ -208,13 +208,13 @@ private void extractArray(ArraySchema schema,
     }
   }
 
-  private void extractCombined(CombinedSchema schema,
-                               String parentOddr,
-                               String oddrn, //null for root
-                               String name,
-                               Boolean nullable,
-                               ImmutableSet<String> registeredRecords,
-                               List<DataSetField> sink) {
+  private static void extractCombined(CombinedSchema schema,
+                                      String parentOddr,
+                                      String oddrn, //null for root
+                                      String name,
+                                      Boolean nullable,
+                                      ImmutableSet<String> registeredRecords,
+                                      List<DataSetField> sink) {
     String combineType = "unknown";
     if (schema.getCriterion() == CombinedSchema.ALL_CRITERION) {
       combineType = "allOf";
@@ -255,24 +255,24 @@ private void extractCombined(CombinedSchema schema,
     }
   }
 
-  private String getDescription(Schema schema) {
+  private static String getDescription(Schema schema) {
     return Optional.ofNullable(schema.getTitle())
         .orElse(schema.getDescription());
   }
 
-  private String logicalTypeName(Schema schema) {
+  private static String logicalTypeName(Schema schema) {
     return schema.getClass()
         .getSimpleName()
         .replace("Schema", "");
   }
 
-  private DataSetField createDataSetField(Schema schema,
-                                          String name,
-                                          String parentOddrn,
-                                          String oddrn,
-                                          DataSetFieldType.TypeEnum type,
-                                          String logicalType,
-                                          Boolean nullable) {
+  private static DataSetField createDataSetField(Schema schema,
+                                                 String name,
+                                                 String parentOddrn,
+                                                 String oddrn,
+                                                 DataSetFieldType.TypeEnum type,
+                                                 String logicalType,
+                                                 Boolean nullable) {
     return new DataSetField()
         .name(name)
         .parentFieldOddrn(parentOddrn)
@@ -286,7 +286,7 @@ private DataSetField createDataSetField(Schema schema,
         );
   }
 
-  private DataSetFieldType.TypeEnum mapType(Schema type) {
+  private static DataSetFieldType.TypeEnum mapType(Schema type) {
     if (type instanceof NumberSchema) {
       return DataSetFieldType.TypeEnum.NUMBER;
     }
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/ProtoExtractor.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/ProtoExtractor.java
index b4a53782391..c1316172f30 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/ProtoExtractor.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/integration/odd/schema/ProtoExtractor.java
@@ -15,20 +15,17 @@
 import com.google.protobuf.UInt32Value;
 import com.google.protobuf.UInt64Value;
 import com.google.protobuf.Value;
-import com.provectus.kafka.ui.service.integration.odd.Oddrn;
 import com.provectus.kafka.ui.sr.model.SchemaSubject;
 import io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
-import lombok.experimental.UtilityClass;
 import org.opendatadiscovery.client.model.DataSetField;
 import org.opendatadiscovery.client.model.DataSetFieldType;
 import org.opendatadiscovery.client.model.DataSetFieldType.TypeEnum;
 import org.opendatadiscovery.oddrn.model.KafkaPath;
 
-@UtilityClass
-class ProtoExtractor {
+final class ProtoExtractor {
 
   private static final Set<String> PRIMITIVES_WRAPPER_TYPE_NAMES = Set.of(
       BoolValue.getDescriptor().getFullName(),
@@ -42,7 +39,10 @@ class ProtoExtractor {
       DoubleValue.getDescriptor().getFullName()
   );
 
-  List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean isKey) {
+  private ProtoExtractor() {
+  }
+
+  static List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean isKey) {
     Descriptor schema = new ProtobufSchema(subject.getSchema()).toDescriptor();
     List<DataSetField> result = new ArrayList<>();
     result.add(DataSetFieldsExtractors.rootField(topicOddrn, isKey));
@@ -60,14 +60,14 @@ List<DataSetField> extract(SchemaSubject subject, KafkaPath topicOddrn, boolean
     return result;
   }
 
-  private void extract(Descriptors.FieldDescriptor field,
-                       String parentOddr,
-                       String oddrn, //null for root
-                       String name,
-                       boolean nullable,
-                       boolean repeated,
-                       ImmutableSet<String> registeredRecords,
-                       List<DataSetField> sink) {
+  private static void extract(Descriptors.FieldDescriptor field,
+                              String parentOddr,
+                              String oddrn, //null for root
+                              String name,
+                              boolean nullable,
+                              boolean repeated,
+                              ImmutableSet<String> registeredRecords,
+                              List<DataSetField> sink) {
     if (repeated) {
       extractRepeated(field, parentOddr, oddrn, name, nullable, registeredRecords, sink);
     } else if (field.getType() == Descriptors.FieldDescriptor.Type.MESSAGE) {
@@ -79,12 +79,12 @@ private void extract(Descriptors.FieldDescriptor field,
 
   // converts some(!) Protobuf Well-known type (from google.protobuf.* packages)
   // see JsonFormat::buildWellKnownTypePrinters for impl details
-  private boolean extractProtoWellKnownType(Descriptors.FieldDescriptor field,
-                                            String parentOddr,
-                                            String oddrn, //null for root
-                                            String name,
-                                            boolean nullable,
-                                            List<DataSetField> sink) {
+  private static boolean extractProtoWellKnownType(Descriptors.FieldDescriptor field,
+                                                   String parentOddr,
+                                                   String oddrn, //null for root
+                                                   String name,
+                                                   boolean nullable,
+                                                   List<DataSetField> sink) {
     // all well-known types are messages
     if (field.getType() != Descriptors.FieldDescriptor.Type.MESSAGE) {
       return false;
@@ -111,13 +111,13 @@ private boolean extractProtoWellKnownType(Descriptors.FieldDescriptor field,
     return false;
   }
 
-  private void extractRepeated(Descriptors.FieldDescriptor field,
-                               String parentOddr,
-                               String oddrn, //null for root
-                               String name,
-                               boolean nullable,
-                               ImmutableSet<String> registeredRecords,
-                               List<DataSetField> sink) {
+  private static void extractRepeated(Descriptors.FieldDescriptor field,
+                                      String parentOddr,
+                                      String oddrn, //null for root
+                                      String name,
+                                      boolean nullable,
+                                      ImmutableSet<String> registeredRecords,
+                                      List<DataSetField> sink) {
     sink.add(createDataSetField(name, parentOddr, oddrn, TypeEnum.LIST, "repeated", nullable));
 
     String itemName = field.getType() == Descriptors.FieldDescriptor.Type.MESSAGE
@@ -136,13 +136,13 @@ private void extractRepeated(Descriptors.FieldDescriptor field,
     );
   }
 
-  private void extractMessage(Descriptors.FieldDescriptor field,
-                              String parentOddr,
-                              String oddrn, //null for root
-                              String name,
-                              boolean nullable,
-                              ImmutableSet<String> registeredRecords,
-                              List<DataSetField> sink) {
+  private static void extractMessage(Descriptors.FieldDescriptor field,
+                                     String parentOddr,
+                                     String oddrn, //null for root
+                                     String name,
+                                     boolean nullable,
+                                     ImmutableSet<String> registeredRecords,
+                                     List<DataSetField> sink) {
     if (extractProtoWellKnownType(field, parentOddr, oddrn, name, nullable, sink)) {
       return;
     }
@@ -173,12 +173,12 @@ private void extractMessage(Descriptors.FieldDescriptor field,
         });
   }
 
-  private void extractPrimitive(Descriptors.FieldDescriptor field,
-                                String parentOddr,
-                                String oddrn,
-                                String name,
-                                boolean nullable,
-                                List<DataSetField> sink) {
+  private static void extractPrimitive(Descriptors.FieldDescriptor field,
+                                       String parentOddr,
+                                       String oddrn,
+                                       String name,
+                                       boolean nullable,
+                                       List<DataSetField> sink) {
     sink.add(
         createDataSetField(
             name,
@@ -191,18 +191,18 @@ private void extractPrimitive(Descriptors.FieldDescriptor field,
     );
   }
 
-  private String getLogicalTypeName(Descriptors.FieldDescriptor f) {
+  private static String getLogicalTypeName(Descriptors.FieldDescriptor f) {
     return f.getType() == Descriptors.FieldDescriptor.Type.MESSAGE
         ? f.getMessageType().getFullName()
         : f.getType().name().toLowerCase();
   }
 
-  private DataSetField createDataSetField(String name,
-                                          String parentOddrn,
-                                          String oddrn,
-                                          TypeEnum type,
-                                          String logicalType,
-                                          Boolean nullable) {
+  private static DataSetField createDataSetField(String name,
+                                                 String parentOddrn,
+                                                 String oddrn,
+                                                 TypeEnum type,
+                                                 String logicalType,
+                                                 Boolean nullable) {
     return new DataSetField()
         .name(name)
         .parentFieldOddrn(parentOddrn)
@@ -216,7 +216,7 @@ private DataSetField createDataSetField(String name,
   }
 
 
-  private TypeEnum mapType(Descriptors.FieldDescriptor.Type type) {
+  private static TypeEnum mapType(Descriptors.FieldDescriptor.Type type) {
     return switch (type) {
       case INT32, INT64, SINT32, SFIXED32, SINT64, UINT32, UINT64, FIXED32, FIXED64, SFIXED64 -> TypeEnum.INTEGER;
       case FLOAT, DOUBLE -> TypeEnum.NUMBER;
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaServicesValidation.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaServicesValidation.java
index 7f5b8c45f2a..31d90244ebe 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaServicesValidation.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaServicesValidation.java
@@ -1,6 +1,7 @@
 package com.provectus.kafka.ui.util;
 
-import com.provectus.kafka.ui.config.ClustersProperties;
+import static com.provectus.kafka.ui.config.ClustersProperties.TruststoreConfig;
+
 import com.provectus.kafka.ui.connect.api.KafkaConnectClientApi;
 import com.provectus.kafka.ui.model.ApplicationPropertyValidationDTO;
 import com.provectus.kafka.ui.service.ReactiveAdminClient;
@@ -13,38 +14,36 @@
 import java.util.Properties;
 import java.util.function.Supplier;
 import javax.annotation.Nullable;
-import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.TrustManagerFactory;
-import lombok.experimental.UtilityClass;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.kafka.clients.admin.AdminClient;
 import org.apache.kafka.clients.admin.AdminClientConfig;
 import org.springframework.util.ResourceUtils;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
-import reactor.util.function.Tuple2;
-import reactor.util.function.Tuples;
 
 @Slf4j
-@UtilityClass
-public class KafkaServicesValidation {
+public final class KafkaServicesValidation {
+
+  private KafkaServicesValidation() {
+  }
 
-  private Mono<ApplicationPropertyValidationDTO> valid() {
+  private static Mono<ApplicationPropertyValidationDTO> valid() {
     return Mono.just(new ApplicationPropertyValidationDTO().error(false));
   }
 
-  private Mono<ApplicationPropertyValidationDTO> invalid(String errorMsg) {
+  private static Mono<ApplicationPropertyValidationDTO> invalid(String errorMsg) {
     return Mono.just(new ApplicationPropertyValidationDTO().error(true).errorMessage(errorMsg));
   }
 
-  private Mono<ApplicationPropertyValidationDTO> invalid(Throwable th) {
+  private static Mono<ApplicationPropertyValidationDTO> invalid(Throwable th) {
     return Mono.just(new ApplicationPropertyValidationDTO().error(true).errorMessage(th.getMessage()));
   }
 
   /**
    * Returns error msg, if any.
    */
-  public Optional<String> validateTruststore(ClustersProperties.TruststoreConfig truststoreConfig) {
+  public static Optional<String> validateTruststore(TruststoreConfig truststoreConfig) {
     if (truststoreConfig.getTruststoreLocation() != null && truststoreConfig.getTruststorePassword() != null) {
       try {
         KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
@@ -63,10 +62,10 @@ public Optional<String> validateTruststore(ClustersProperties.TruststoreConfig t
     return Optional.empty();
   }
 
-  public Mono<ApplicationPropertyValidationDTO> validateClusterConnection(String bootstrapServers,
-                                                                          Properties clusterProps,
-                                                                          @Nullable
-                                                                          ClustersProperties.TruststoreConfig ssl) {
+  public static Mono<ApplicationPropertyValidationDTO> validateClusterConnection(String bootstrapServers,
+                                                                                 Properties clusterProps,
+                                                                                 @Nullable
+                                                                                 TruststoreConfig ssl) {
     Properties properties = new Properties();
     SslPropertiesUtil.addKafkaSslProperties(ssl, properties);
     properties.putAll(clusterProps);
@@ -93,7 +92,7 @@ public Mono<ApplicationPropertyValidationDTO> validateClusterConnection(String b
         });
   }
 
-  public Mono<ApplicationPropertyValidationDTO> validateSchemaRegistry(
+  public static Mono<ApplicationPropertyValidationDTO> validateSchemaRegistry(
       Supplier<ReactiveFailover<KafkaSrClientApi>> clientSupplier) {
     ReactiveFailover<KafkaSrClientApi> client;
     try {
@@ -108,7 +107,7 @@ public Mono<ApplicationPropertyValidationDTO> validateSchemaRegistry(
         .onErrorResume(KafkaServicesValidation::invalid);
   }
 
-  public Mono<ApplicationPropertyValidationDTO> validateConnect(
+  public static Mono<ApplicationPropertyValidationDTO> validateConnect(
       Supplier<ReactiveFailover<KafkaConnectClientApi>> clientSupplier) {
     ReactiveFailover<KafkaConnectClientApi> client;
     try {
@@ -123,7 +122,8 @@ public Mono<ApplicationPropertyValidationDTO> validateConnect(
         .onErrorResume(KafkaServicesValidation::invalid);
   }
 
-  public Mono<ApplicationPropertyValidationDTO> validateKsql(Supplier<ReactiveFailover<KsqlApiClient>> clientSupplier) {
+  public static Mono<ApplicationPropertyValidationDTO> validateKsql(
+      Supplier<ReactiveFailover<KsqlApiClient>> clientSupplier) {
     ReactiveFailover<KsqlApiClient> client;
     try {
       client = clientSupplier.get();
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaVersion.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaVersion.java
index 48ff7ff1214..5ed21c6a6e2 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaVersion.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/KafkaVersion.java
@@ -1,11 +1,12 @@
 package com.provectus.kafka.ui.util;
 
-import lombok.experimental.UtilityClass;
 import lombok.extern.slf4j.Slf4j;
 
-@UtilityClass
 @Slf4j
-public class KafkaVersion {
+public final class KafkaVersion {
+
+  private KafkaVersion() {
+  }
 
   public static float parse(String version) throws NumberFormatException {
     log.trace("Parsing cluster version [{}]", version);
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/SslPropertiesUtil.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/SslPropertiesUtil.java
index ea120076373..4d157fbcb5f 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/SslPropertiesUtil.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/SslPropertiesUtil.java
@@ -1,27 +1,17 @@
 package com.provectus.kafka.ui.util;
 
 import com.provectus.kafka.ui.config.ClustersProperties;
-import io.netty.handler.ssl.SslContext;
-import io.netty.handler.ssl.SslContextBuilder;
-import java.io.FileInputStream;
-import java.security.KeyStore;
 import java.util.Properties;
 import javax.annotation.Nullable;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManagerFactory;
-import lombok.SneakyThrows;
-import lombok.experimental.UtilityClass;
 import org.apache.kafka.common.config.SslConfigs;
-import org.springframework.http.client.reactive.ReactorClientHttpConnector;
-import org.springframework.util.ResourceUtils;
-import reactor.netty.http.client.HttpClient;
 
-@UtilityClass
-public class SslPropertiesUtil {
+public final class SslPropertiesUtil {
 
-  public void addKafkaSslProperties(@Nullable ClustersProperties.TruststoreConfig truststoreConfig,
-                                    Properties sink) {
+  private SslPropertiesUtil() {
+  }
+
+  public static void addKafkaSslProperties(@Nullable ClustersProperties.TruststoreConfig truststoreConfig,
+                                           Properties sink) {
     if (truststoreConfig != null && truststoreConfig.getTruststoreLocation() != null) {
       sink.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, truststoreConfig.getTruststoreLocation());
       if (truststoreConfig.getTruststorePassword() != null) {


Test patch: