Created
April 6, 2020 13:33
-
-
Save ythirion/745839f12c43a6563ce21dadf3c0014b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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