Testing with Non-identically Distributed Samples