assert([1, 2, 3, 4, 5].s[].isPermutationOf([1, 2, 4, 5, 3].s[])); assert(![1, 2, 3, 4, 5].s[].isPermutationOf([1, 4, 5, 3].s[]));
assert(!``w.isAnagramOf(``)); assert(`äöå`w.isAnagramOf(`åäö`)); assert(`äöå`.isAnagramOf(`åäö`w)); assert(`äöå`w.isAnagramOf(`åäö`w)); assert(`äöå`d.isAnagramOf(`åäö`)); assert(`äöå`.isAnagramOf(`åäö`d)); assert(`äöå`d.isAnagramOf(`åäö`d));
assert(`äöå`.isAnagramOf(`åäö`)); assert(!`äöå`.isAnagramOf(`xyz`)); assert(!`äöå`.isAnagramOf(``)); assert(!``.isAnagramOf(`åäö`));
import std.conv: to; auto x = `äöå`.to!(dchar[]); auto y = sort(x); alias Y = typeof(y); immutable z = `åäö`; assert(y.isAnagramOf(z)); assert(z.isAnagramOf(y));