Java get next enum

enum E {
    X, Y, Z;
}
public E getNext() {
    E[] e = E.values();
    int i = 0;
    for (; e[i] != this; i++)
        ;
    i++;
    i
    return e[i];
}