TopicDiff { public boolean changesReplicationFactor() { return this.differences.containsKey(NumReplicasDifference.ADDRESS); } private  TopicDiff(Map<String, Difference> differences, ObjectMeta objectMeta); static TopicDiff diff(Topic source, Topic target); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); boolean isEmpty(); boolean changesNumPartitions(); int numPartitionsDelta(); boolean changesConfig(); boolean changesReplicationFactor(); Topic apply(Topic topic); String conflict(TopicDiff other); boolean conflicts(TopicDiff other); TopicDiff merge(TopicDiff other);  }
@Test public void testChangesReplicationFactor() { Topic topicC = new Topic.Builder(topicB.getTopicName(), topicB.getNumPartitions(), (short) 2, topicB.getConfig()).build(); Topic topicD = new Topic.Builder(topicB.getTopicName(), topicC.getNumPartitions() + 1, (short) 2, topicB.getConfig()).build(); Topic topicE = new Topic.Builder(topicB.getTopicName(), topicB.getNumPartitions(), (short) 3, topicB.getConfig()).build(); assertThat(TopicDiff.diff(topicC, topicD).changesReplicationFactor(), is(false)); assertThat(TopicDiff.diff(topicD, topicE).changesReplicationFactor(), is(true)); assertThat(TopicDiff.diff(topicC, topicE).changesReplicationFactor(), is(true)); }