def METHOD_NAME(self):
    """Test if relations and half of heads and tails are not corrupted."""
    negative_batch, batch_filter = self.instance.sample(positive_batch=self.positive_batch)
    # Test that half of the subjects and half of the objects are corrupted
    positive_batch = self.positive_batch.unsqueeze(dim=1)
    num_triples = negative_batch[..., 0].numel()
    half_size = num_triples // 2
    num_subj_corrupted = (positive_batch[..., 0] != negative_batch[..., 0]).sum()
    num_obj_corrupted = (positive_batch[..., 2] != negative_batch[..., 2]).sum()
    assert num_obj_corrupted - 1 <= num_subj_corrupted
    assert num_subj_corrupted - 1 <= num_obj_corrupted
    assert num_subj_corrupted - 1 <= num_triples
    assert half_size - 1 <= num_subj_corrupted