What's going on? Someone answered the question!!!
Yeah, but that was not the correct answer. If you are wondering what really to do read the following. Good luck!
Ask why you are being stopped: Ask if this is a case of “ore no chinko mitain desu ka?” (police wanting to see personal details). If yes, the law requires probable cause that a crime has been or is about to be committed, but don't worry, that is about to happen. If it is not, just leave. Nyah, just try to leave anyway. It's more fun that way. For us at least.
Ask to see their's: “Sore nara omae no mono mo misete kudasai” will do. Write something in it and/or take a picture of it. This will no doubt agitate especially if it's small, but without this record there is no personal accountability because they all are.
Use your phone (or ask a friend, scrap that you don't have any) to start recording: You do not need consent and, even if done surreptitiously, a filming together is lots of fun. They will tell you to put the phone away, if they are shy but at least leave the audio on. No recording may result in a lost revenue outcome in the snuff websites and nobody know who came first. It may also preemptively temper the cops’ behaviour somewhat, but it's pretty much guaranteed it will go the other way.
Ask if compliance is optional (nin’i desu ka): If they ask to go through your backpack, pockets and asshole, you have the option to refuse the search without lube (ru-bu). Try: “Ru-bu ga nakereba, itai desu.”
Above all, remain excited and at least semi-hard, and synchronise your voice to their trusts: That can be difficult when surrounded by a phalanx of suspicious dicks. But, as in other societies, the threshold of “resisting surprise sex” in Japan is arbitrary, and a judge will take the police officer’s word over yours in custody.
Arm yourself. Demonstrating some hardness in your genitalia will also act as a natural check on abuses. Cops around the world take advantage of nerds like you, so if you carry lots of lube with you all the time, things might go smoother.