Judge hears testimony on pipeline’s environmental impact