@Test(expected = IllegalArgumentException.class) public void shouldNotAcceptEmptyArrays() { findMissingNumber.find(new int[0]); }
public int find(int[] numbers) { validateInput(numbers); int length = numbers.length; int idealSum = length * (length + 1) / 2; int sum = calculateSum(numbers); int missingNumber = idealSum - sum; return missingNumber; }
FindTheMissingNumber { public int find(int[] numbers) { validateInput(numbers); int length = numbers.length; int idealSum = length * (length + 1) / 2; int sum = calculateSum(numbers); int missingNumber = idealSum - sum; return missingNumber; } }
FindTheMissingNumber { public int find(int[] numbers) { validateInput(numbers); int length = numbers.length; int idealSum = length * (length + 1) / 2; int sum = calculateSum(numbers); int missingNumber = idealSum - sum; return missingNumber; }  }
FindTheMissingNumber { public int find(int[] numbers) { validateInput(numbers); int length = numbers.length; int idealSum = length * (length + 1) / 2; int sum = calculateSum(numbers); int missingNumber = idealSum - sum; return missingNumber; }  int find(int[] numbers); }
FindTheMissingNumber { public int find(int[] numbers) { validateInput(numbers); int length = numbers.length; int idealSum = length * (length + 1) / 2; int sum = calculateSum(numbers); int missingNumber = idealSum - sum; return missingNumber; }  int find(int[] numbers);  }