@Override
    public String toString() {
        StringBuilder sb = new StringBuilder("PartitionRuntimeState [" + stamp + "]{" + System.lineSeparator());
        for (PartitionReplica replica : allReplicas) {
            sb.append(replica).append(System.lineSeparator());
        }
        sb.append(", completedMigrations=").append(completedMigrations);
        sb.append('}');
        return sb.toString();
    }
@Test
    public void toString_whenDeserialized() throws UnknownHostException {
        PartitionRuntimeState state = createPartitionState(0,
                replica("127.0.0.1", 5701),
                replica("127.0.0.2", 5702)
        );

        state = serializeAndDeserialize(state);
        assertContains(state.toString(), "127.0.0.1");
        assertContains(state.toString(), "127.0.0.2");
    }