Skip to content

Instantly share code, notes, and snippets.

@jmkim
Created August 13, 2025 21:56
Show Gist options
  • Save jmkim/5750a737639bdbc49b3e2aa0b3b0f82f to your computer and use it in GitHub Desktop.
Save jmkim/5750a737639bdbc49b3e2aa0b3b0f82f to your computer and use it in GitHub Desktop.
private long getRandomBankCapacity() {
long[] capacities = {
32L * 1024 * 1024, // 32 MiB
64L * 1024 * 1024, // 64 MiB
128L * 1024 * 1024, // 128 MiB
256L * 1024 * 1024, // 256 MiB
512L * 1024 * 1024, // 512 MiB
1024L * 1024 * 1024, // 1 GiB
2L * 1024 * 1024 * 1024, // 2 GiB
4L * 1024 * 1024 * 1024, // 4 GiB
8L * 1024 * 1024 * 1024, // 8 GiB
16L * 1024 * 1024 * 1024, // 16 GiB
32L * 1024 * 1024 * 1024, // 32 GiB
64L * 1024 * 1024 * 1024, // 64 GiB
128L * 1024 * 1024 * 1024, // 128 GiB
256L * 1024 * 1024 * 1024 // 256 GiB
};
return capacities[rnd.nextInt(capacities.length)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment