I hate to ask and bother you with my problem, specially this, which is pretty complicated.
Result: count=581, total_z=0, total_y=19, total_x=19, and a long map of trues and falses.
Java Input is: width=19, depth=19, height=19
Result: count=1093, total_z=19, total_y=19, total_x=19, and a long map of trues and falses.
First of all I don't know how to properly translate the .hasOwnProperty method, I think that what I made is fairly correct.
I think that the problem is on the loops: In the .js code uses arrays and I used Lists, and I also don't know how to do that part.
Well, here is the code. I hope you can understand it!