Created
July 5, 2020 11:14
-
-
Save theboreddev/c42aee0608c066ea4648c4fab12a7534 to your computer and use it in GitHub Desktop.
oldchain
This file contains hidden or 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
final Car car = new Car(); | |
final CarWashStep chain = new InitialWashStep(); | |
chain.andThen(new SoapStep()) | |
.andThen(new RinseStep()) | |
.andThen(new PolishStep()) | |
.andThen(new DryStep()); | |
final Car finalCar = chain.applyTo(car); | |
System.out.println("Final car state is " + finalCar.washState()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment