Finding Duplicate Java
Finding Duplicate: A TDD Exercise
The problem
Approach using TDD
Tests and solution snippets
@Test
public void two_ones_must_return_true() {
// arrange
int[] arr = { 1, 1 };
// act
Duplicate cut = new Duplicate();
var result = cut.hasDuplicate(arr);
// assert
assertTrue(result);
}Refactor Tests
Last updated