From a1a43e64ead82e97b2886497db8ee47e029b190e Mon Sep 17 00:00:00 2001 From: ishwardas Date: Tue, 2 Aug 2016 09:01:02 -0500 Subject: [PATCH] removed comments --- .../java/arrays/ArraysJoinAndSplitJUnitTest.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java b/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java index 6b36301915..bbbef46933 100644 --- a/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java +++ b/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java @@ -7,7 +7,6 @@ import org.junit.Test; public class ArraysJoinAndSplitJUnitTest { - //pizza toppings private final String[] sauces = {"Marinara", "Olive Oil"}; private final String[] cheeses = {"Mozzarella", "Feta", "Parmesan"}; private final String[] vegetables = {"Olives", "Spinach", "Green Peppers"}; @@ -15,21 +14,16 @@ public class ArraysJoinAndSplitJUnitTest { @Test public void givenThreeStringArrays_whenJoiningIntoOneStringArray_ShouldSucceed() throws Exception { - //create the destination array String[] toppings = new String[sauces.length + cheeses.length + vegetables.length]; - //add the sauces System.arraycopy(sauces, 0, toppings, 0, sauces.length); int AddedSoFarCount = sauces.length; - //add the cheeses System.arraycopy(cheeses, 0, toppings, AddedSoFarCount, cheeses.length); AddedSoFarCount += cheeses.length; - //add the vegetables System.arraycopy(vegetables, 0, toppings, AddedSoFarCount, vegetables.length); - //check the result Assert.assertArrayEquals(toppings, new String[] {"Marinara", "Olive Oil", "Mozzarella", "Feta", "Parmesan", "Olives", "Spinach", "Green Peppers"} ); @@ -39,14 +33,11 @@ public class ArraysJoinAndSplitJUnitTest { private final String[] customers = {"Jay", "Harry", "Ronnie", "Gary", "Ross"}; @Test public void givenOneStringArray_whenSplittingInHalfBetweenTwoStringArrays_ShouldSucceed() throws Exception { - //split the orders in half, rounding up int ordersHalved = (customers.length / 2) + (customers.length % 2); - //divide the orders between two drivers String[] driverOne = Arrays.copyOf(customers, ordersHalved); String[] driverTwo = Arrays.copyOfRange(customers, ordersHalved, customers.length); - //check ther result Assert.assertArrayEquals(driverOne, new String[] {"Jay", "Harry", "Ronnie"} ); Assert.assertArrayEquals(driverTwo, new String[] {"Gary", "Ross"} ); }