package com.levelup.java.array;

import static org.junit.Assert.assertTrue;

import java.util.Arrays;

import org.junit.Test;

/**
 * This java example will demonstrate shifting the values in array
 * 
 * @author Justin Musgrove
 * @see <a href='http://www.leveluplunch.com/java/'></a>
 * 
 */
public class ShiftValuesInArray {

	String[] shoeTypes = {
			"Nike", 
			"Puma", 
			"Converse", 
			"Reebok", 
			"Asics"};
	
	@Test
	public void shift_values_in_array_with_java () {
		String[] shoeTypesMinusNike = new String[shoeTypes.length - 1];
		System.arraycopy(shoeTypes, 1, shoeTypesMinusNike, 0, shoeTypes.length - 1);
		
		assertTrue(Arrays.binarySearch(shoeTypesMinusNike, "Nike") < 0);
	}
	
}

@@ -96,16 +96,48 @@
 rrays;%0A%0A
+import org.apache.log4j.Logger;%0A
 import o
@@ -308,10 +308,66 @@
 ava/
-'%3E
+examples/shift-elements-in-array/'%3EShift elements in array
 %3C/a%3E
@@ -409,17 +409,160 @@
 Array %7B%0A
+%09
 %0A
+%09private static final Logger logger = Logger.getLogger(ShiftValuesInArray.class);%0A%0A%09@Test%0A%09public void shift_values_in_array_with_java () %7B%0A%0A%09
 %09String%5B
@@ -580,16 +580,17 @@
  = %7B%0A%09%09%09
+%09
 %22Nike%22, 
@@ -586,24 +586,25 @@
 %09%09%09%22Nike%22, %0A
+%09
 %09%09%09%22Puma%22, %0A
@@ -606,16 +606,17 @@
 a%22, %0A%09%09%09
+%09
 %22Convers
@@ -616,24 +616,25 @@
 Converse%22, %0A
+%09
 %09%09%09%22Reebok%22,
@@ -638,16 +638,17 @@
 k%22, %0A%09%09%09
+%09
 %22Asics%22%7D
@@ -654,65 +654,9 @@
 %7D;%0A%09
-%0A%09@Test%0A%09public void shift_values_in_array_with_java () %7B
+%09
 %0A%09%09S
@@ -800,16 +800,71 @@
  1);%0A%09%09%0A
+%09%09logger.info(Arrays.toString(shoeTypesMinusNike));%0A%09%09%0A
 %09%09assert

add logger, formatter, fix url