Gil Zilberfeld explains refactoring in legacy code, when using ApprovalTests and something unexpected happens

Refactoring Kung-Fu, Part VI

Ok, time to run the test. Well, that’s interesting. The test is not even running until the end, we’re crashing before it completes. Let’s see what’s wrong. Seems that this line breaks: List<Ingredient> fillingIngredients = new ArrayList<Ingredient>(ingredients.subList(1, ingredients.size() – 1)); Read more…