What's missing to answer this question is the usage of the method: whether the callers usually pass constants or not. If the callers usually invoke via
getResult(a, null) and/or
getResult(null, b) then we don't really need multiple parameters, and you should have multiple methods instead of a single method.
Even if callers occasionally do
getResult(a,b), but more often one of the prior forms passing null, you should have multiple methods.
In my opinion, the ease and simplicity for the consuming client programmer — even if just you — is the primary consideration (vs. the underlying implementation). Teasing these invocations apart would make the consuming client easier to understand, easier for the IDE to isolate the different use cases, easier to refactor, etc... It will also eliminate those conditionals in those cases of passing nulls.
If these are separate use cases from the client's perspective (as per passing null as constants), then there is no reason to conflate the cases in the first place (e.g. into a god method).