package io.confluent.connect.jdbc.sink.metadata;

import org.apache.kafka.connect.data.Schema;

public class SchemaPair {
  public final Schema keySchema;
  public final Schema valueSchema;

  public SchemaPair(Schema keySchema, Schema valueSchema) {
    this.keySchema = keySchema;
    this.valueSchema = valueSchema;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    SchemaPair that = (SchemaPair) o;

    if (keySchema != null ? !keySchema.equals(that.keySchema) : that.keySchema != null) {
      return false;
    }
    return valueSchema != null ? valueSchema.equals(that.valueSchema) : that.valueSchema == null;
  }

  @Override
  public int hashCode() {
    int result = keySchema != null ? keySchema.hashCode() : 0;
    result = 31 * result + (valueSchema != null ? valueSchema.hashCode() : 0);
    return result;
  }
}

@@ -89,16 +89,43 @@
 chema;%0A%0A
+import java.util.Objects;%0A%0A
 public c
@@ -515,17 +515,16 @@
 ;%0A    %7D%0A
-%0A
     Sche
@@ -557,55 +557,34 @@
  o;%0A
-%0A
     
-if (keySchema != null ? !keySchema
+return Objects
 .equals(
 that
@@ -579,21 +579,16 @@
 .equals(
-that.
 keySchem
@@ -584,27 +584,25 @@
 ls(keySchema
-) :
+,
  that.keySch
@@ -608,98 +608,39 @@
 hema
- != null) %7B%0A      return false;
+) &&
 %0A    
-%7D%0A
     
-return valueSchema != null ? valueSchema
+   Objects
 .equals(
 that
@@ -635,21 +635,16 @@
 .equals(
-that.
 valueSch
@@ -646,19 +646,17 @@
 ueSchema
-) :
+,
  that.va
@@ -664,24 +664,17 @@
 ueSchema
- == null
+)
 ;%0A  %7D%0A%0A 
@@ -718,163 +718,51 @@
     
-int result = keySchema != null ? keySchema.hashCode() : 0;%0A    result = 31 * result + (valueSchema != null ? valueSchema.hashCode() : 0);%0A    return result
+return Objects.hash(keySchema, valueSchema)
 ;%0A  

use java.util.Objects for equals / hashCode