Controlling access with implementation hiding in Java