Nevermind, It seems that in my previous tests, I forgot to make the inner classes static. Everything works as expected.