Added proper result typing for JavaStack