Classification and testing under robust model assumptions