### Question:
KeySequenceConfig implements ItemSource<KeySequenceConfig>, Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof KeySequenceConfig)) { return false; } KeySequenceConfig that = (KeySequenceConfig)obj; if (this.seqId != that.seqId) { return false; } if (this.ownerId != that.ownerId) { return false; } if (this.expireAt != that.expireAt) { return false; } if (this.readerIndex != that.readerIndex) { return false; } if (this.writerIndex != that.writerIndex) { return false; } return true; } KeySequenceConfig(long seqId, long readerIndex, long writerIndex); CharSequence getKey(); long getSeqId(); long getOwnerId(); void setOwnerId(long ownerId); long getExpireAt(); void setExpireAt(long expireAt); long nextReaderIndex(); void setReaderIndex(long readerIndex); long nextWriterIndex(); void setWriterIndex(long writerIndex); @Override KeySequenceConfig getSource(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void equalsReturnsFalseIfNullProvided() { KeySequenceConfig keySequenceConfig = KeySequenceConfigRepositoryTest.createDefaultTestKeySequenceConfig(); boolean result = keySequenceConfig.equals(null); assertFalse(result); }
@Test public void equalsReturnsFalseIfWrongTypeProvided() { KeySequenceConfig keySequenceConfig = KeySequenceConfigRepositoryTest.createDefaultTestKeySequenceConfig(); Object object = new Object(); boolean result = keySequenceConfig.equals(object); assertFalse(result); }
@Test public void equalsReturnsFalseIfSequenceIdsAreDifferent() { KeySequenceConfig keySequenceConfig1 = new KeySequenceConfig(DEFAULT_TEST_SEQUENCE_ID, RESERVED_KEYS, RESERVED_KEYS); KeySequenceConfig keySequenceConfig2 = new KeySequenceConfig(DEFAULT_TEST_SEQUENCE_ID + 1, RESERVED_KEYS, RESERVED_KEYS); boolean result = keySequenceConfig1.equals(keySequenceConfig2); assertFalse(result); }
@Test public void equalsReturnsFalseIfReaderKeysAreDifferent() { KeySequenceConfig keySequenceConfig1 = new KeySequenceConfig(DEFAULT_TEST_SEQUENCE_ID, RESERVED_KEYS, RESERVED_KEYS); KeySequenceConfig keySequenceConfig2 = new KeySequenceConfig(DEFAULT_TEST_SEQUENCE_ID, RESERVED_KEYS + 1, RESERVED_KEYS); boolean result = keySequenceConfig1.equals(keySequenceConfig2); assertFalse(result); }
@Test public void equalsReturnsFalseIfWriterKeysAreDifferent() { KeySequenceConfig keySequenceConfig1 = new KeySequenceConfig(DEFAULT_TEST_SEQUENCE_ID, RESERVED_KEYS, RESERVED_KEYS); KeySequenceConfig keySequenceConfig2 = new KeySequenceConfig(DEFAULT_TEST_SEQUENCE_ID, RESERVED_KEYS, RESERVED_KEYS + 1); boolean result = keySequenceConfig1.equals(keySequenceConfig2); assertFalse(result); }