public bool Equals(Needle <T> other) { var target = _target; if (target == null) { return(other._target == null); } return(EqualsExtracted(this, other)); }
private static bool NotEqualsExtracted(Needle <T> left, Needle <T> right) { if (ReferenceEquals(left, null)) { return(!ReferenceEquals(right, null)); } if (ReferenceEquals(right, null)) { return(true); } var leftTarget = left._target; var rightTarget = right._target; if (leftTarget == null) { return(rightTarget != null); } if (rightTarget == null) { return(true); } return(!leftTarget.Equals(rightTarget)); }