PartitionChangeBuilder seems to have an existing issue with preferred leader election. Suppose that a partition has replicas as {1,2,3}, isr as {2,3} and leader as 3. Calling builder.build() on this partition seems to change the leader to 2. This is unnecessary since 2 is not the preferred leader.