Earlier quoted context omitted.
Can you elaborate on that? What's the C code, the translated Java code and your expected Java code? Thanks!
http://lmgtfy.com/?q=duff%27s+device&l=1#
do {
to.set((from = from.shift(1)).get(-1));
} while(--count > 0);
which looks correct to me. Hence my question what orodley thinks is wrong.