diff --git a/README.md b/README.md index ca03b2d..be9135d 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,18 @@ -# ApprovalTests.java.StarterProject +# Refactoring Early Returns [![Build Status](../../workflows/build/badge.svg?branch=main)](../../actions?query=build%3Amain) -This is a starter project for: +2 Practice Exercises for Refactoring Early Returns in Java. -* ApprovalTests in java - see [ApprovalTests.java](https://github.com/approvals/ApprovalTests.java) -* Junit -* Maven - -Works on Mac, Linux and Windows. - -Feel free to copy and go... - -## Starting Point - -The tests in [SampleTests](https://github.com/approvals/ApprovalTests.java.StarterProject/blob/master/src/test/java/org/samples/SampleTests.java) should pass, and then you should delete/modify as needed to get started. - - -Notes: - -* For more information, see the [ApprovalTests.java User Guide](https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/README.md#top) -* You will need a Diff tool. -* Suggestions: - * Mac: [DiffMerge](https://sourcegear.com/diffmerge/) - * Windows: [WinMerge](winmerge.org/) - * Linux: [meld](http://meldmerge.org/) +# Steps for refactoring +1. Add nullable return + 1. set value + 1. if != null return + 1. move if + 1. add else + 1. invert if + 1. repeat until all returns are at the end +1. clean up