Linear Search with Java Tested with junit