TITLE: $\mathcal A^{\mathcal A}\sim\mathcal B^{\mathcal B}\implies\mathcal A\sim\mathcal B\ ?$ (Does A^A ~ B^B imply A ~ B? --- A, B categories)
QUESTION [14 upvotes]: I asked this question on Mathematics Stackexchange, but got no answer.
Let $\mathcal A$ and $\mathcal B$ be nonempty categories whose categories $\mathcal A^{\mathcal A}$ and $\mathcal B^{\mathcal B}$ of endofunctors are equivalent. 

Are $\mathcal A$ and $\mathcal B$ necessarily equivalent?

Implicit assumption: we are working in ZFC, and we assume that ZFC is consistent.
If my understanding is correct, this post of Joel David Hamkins implies that one cannot prove that the answer is Yes, so that either the answer is No, or the question is undecidable. (I think that the answer is No.)
[Reminder 1: Categories are generalized sets in the following sense. Given a set $S$ let $\mathcal C(S)$ be the category whose objects are the elements of $S$ and whose only morphisms are the identity morphisms. Then the assignment $S\mapsto\mathcal C(S)$ commutes with exponentials in the obvious sense.]
[Reminder 2: Infinite cardinals $\kappa$ satisfy $\kappa^\kappa=2^\kappa$. Indeed $\kappa^\kappa\le(2^\kappa)^\kappa=2^{\kappa\kappa}=2^\kappa\le\kappa^\kappa$.]

REPLY [3 votes]: Here is another counterexample, also using groupoids. 
For a group $G$ I will use the notation $G$ also for the corresponding one-object groupoid. If $C$ is the disjoint union of groups $G_i$ and $D$ is the disjoint union of groups $H_j$ then $C^D$ is the product over $j$ of the disjoint union over $i$ of the groupoid $G_i^{H_j}$. If $G$ is an abelian group then $G^H$ is the disjoint union, over all homomorphisms $H\to G$, of $G$.
Putting all of this together, one can work out a description of $A^A$ when the groupoid $A=\infty 1\coprod \infty\mathbb Z$ is the disjoint union of countably infinitely many trivial groups and countably infinitely many infinite cyclic groups. It comes out be the disjoint union of the following groups, each occurring a continuum's worth of times: free abelian groups of all finite ranks, and a countably infinite product of $\mathbb Z$'s.
Now let $B=\infty 1\coprod \infty\mathbb Z\coprod \mathbb Z^2$ be the disjoint union of $A$ with one copy of $\mathbb Z^2$. Then $B^B$ comes out to be isomorphic to $A^A$.