Skip to content

Instantly share code, notes, and snippets.

@ythirion
Created April 6, 2020 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ythirion/745839f12c43a6563ce21dadf3c0014b to your computer and use it in GitHub Desktop.
Save ythirion/745839f12c43a6563ce21dadf3c0014b to your computer and use it in GitHub Desktop.
public class WithdrawGenerator extends Generator<Withdraw> {
public WithdrawGenerator() {
super(Withdraw.class);
}
@Override
public Withdraw generate(SourceOfRandomness sourceOfRandomness, GenerationStatus generationStatus) {
return new Withdraw(sourceOfRandomness.nextDouble(), new Date());
}
}
public class AccountGenerator extends Generator<Account> {
public AccountGenerator() {
super(Account.class);
}
@Override
public Account generate(SourceOfRandomness sourceOfRandomness, GenerationStatus generationStatus) {
return new Account(sourceOfRandomness.nextDouble(),
sourceOfRandomness.nextBoolean(),
sourceOfRandomness.nextDouble());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment