1 | static <A, B> Pair<A, B> randomKeyAndValue(Map<A, B> map) { |
2 | if (empty(map)) null; |
3 | A a = randomKey(map); |
4 | ret pair(a, map.get(a)); |
5 | } |
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019356 |
Snippet name: | randomKeyAndValue |
Eternal ID of this version: | #1019356/1 |
Text MD5: | a7ceb36d71f1eff32de1a7ce77fad50d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-04 14:42:20 |
Source code size: | 140 bytes / 5 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 287 / 312 |
Referenced in: | [show references] |