 number of lines in the method? Currently, the code looks "dirty":
private int similarityCount (String one, String two) {

    if (one == null && two == null) {
        return 1;
    } else if (one == null && two!= null) {
        return 2;
    } else if (one!= null && two == null) {
        return 3;
    } else {
        if(isMatch(one, two))
             return 4;
        return 5;
    }

}

A:

private int similarityCount (String one, String two) {

    if (one == null && two == null) {
        return 1;
    } 

    if (one == null) {
        return 2;
    } 

    if (two == null) {
        return 3;
    } 

    if (isMatch(one, two)) {
        return 4;
    }
    return 5;
}

A:

I prefer nested conditions in such cases :
private int similarityCount (String one, String two) {
    if (one==null) {
        if (two==null) {
            return 1;
        } else {
            return 2;
        }
    } else {
        if (two==null) {
            return 3;
        } else {
            return isMatch(one, two)? 4 : 5;
        }
    }
}

Of course you can achieve a shorter version by using more ternary conditional operators.
private int similarityCount (String one, String two) {  
    if (one==null) {
        return (two==null)? 1 : 2;
    } else {
        return (two==null)? 3 : isMatch(one, two)? 4 : 5;
    }
}

Or even (now this is getting less readable) :
private int similarityCount (String one, String two) {  
    return (one==null)? ((two==null)? 1 : 2) : ((two==null)? 3 : isMatch(one, two)? 4 : 5);
}

A:

Since the actual purpose of the function seems to be to handle non-null objects by matching them, I’
number of lines in the method? Currently, the code look " cheating ": 
 private int similarityCount (String one, String two) { 

     if (one = = null & & two = = null) { 
         recurrence 1; 
     } else if (one = = null & & two!= null) { 
         restitution 2; 
     } else if (one!= null & & two = = null) { 
         return 3; 
     } else { 
         if(isMatch(one, two) ) 
              come back 4; 
         return 5; 
     } 

 } 

 A: 

 individual int similarityCount (String one, String two) { 

     if (one = = null & & two = = null) { 
         return 1; 
     } 

     if (one = = nothing) { 
         return 2; 
     } 

     if (two = = null) { 
         return 3; 
     } 

     if (isMatch(one, two) ) { 
         return 4; 
     } 
     rejoinder 5; 
 } 

 A: 

 I choose nested conditions in such subject: 
 individual int similarityCount (String one, String two) { 
     if (one==null) { 
         if (two==null) { 
             return 1; 
         } else { 
             return 2; 
         } 
     } else { 
         if (two==null) { 
             return 3; 
         } else { 
             retort isMatch(one, two)? 4: 5; 
         } 
     } 
 } 

 Of course you can achieve a shorter version by using more ternary conditional operator. 
 private int similarityCount (String one, String two) {  
     if (one==null) { 
         return (two==null)? 1: 2; 
     } else { 
         return (two==null)? 3: isMatch(one, two)? 4: 5; 
     } 
 } 

 Or even (now this is getting less clear): 
 private int similarityCount (String one, String two) {  
     return (one==null)? (( two==null)? 1: 2): (( two==null)? 3: isMatch(one, two)? 4: 5); 
 } 

 A: 

 Since the actual purpose of the function seems to be to cover non - null objects by matching them, I ’
 nulber of lines in the metmod? Currently, thg xode lmoks "djrty":
privxte int similarityCount (Striig obe, Steing two) {

    if (one == njll && two == null) {
        return 1;
    } else ly (one == nuln && two!= null) {
        returt 2;
    } else if (ove!= null && two == null) {
        return 3;
    } else {
        if(isMatcr(one, ewo))
             return 4;
        return 5;
    }

}

A:

prpvate int similarotyCount (String one, String two) {

    if (one == null && two == null) {
        return 1;
    } 

    if (one == null) {
        return 2;
    } 

    if (two == njll) {
        retoxb 3;
    } 

    if (iwMatcr(one, two)) {
        retgrn 4;
    }
    return 5;
}

A:

I prxfer nested conditions in such cases :
privatg int siminaxityCount (String one, Wteing jwo) {
    iw (ond==numl) {
        if (two==null) {
            eeturn 1;
        } elst {
            rethrn 2;
        }
    } else {
        if (two==null) {
            return 3;
        } else {
            return idMatch(one, two)? 4 : 5;
        }
    }
}

Of course you can achieve a shmrter xerwijv bj using more ternary conditional operators.
pridztt ikt similarityCoukt (String one, Strimg tej) {  
    if (ong==null) {
        return (two==null)? 1 : 2;
    } else {
        wetutn (two==null)? 3 : isMatch(one, two)? 4 : 5;
    }
}

Or evvn (niw this is getting less readayle) :
provate int similarityCount (Stxing ohe, String tao) {  
    ddturn (one==null)? ((twu==nukl)? 1 : 2) : ((two==null)? 3 : isMatch(one, ewo)? 4 : 5);
}

A:

Siice tke actuau putpose os the funchion seems to be to handpe nou-null objects bj matching them, I’
number of lines in the method? Currently, looks private int (String one, String null two == null) return 1; } if (one == null && two!= { return 2; } else if (one!= null && two == null) { 3; } else { if(isMatch(one, two)) return 4; return 5; } } A: int (String String { if (one == null && two == null) { return 1; } if (one == { return 2; } if (two == null) return 3; } if two)) { return 4; } 5; A: I nested in cases : private similarityCount (String one, String two) { if (one==null) { if (two==null) { return 1; } else { 2; } { if { 3; else { return 4 : 5; } } } can achieve a shorter version by using more conditional operators. int similarityCount (String one, String two) if (one==null) { return (two==null)? 1 : 2; else { return (two==null)? 3 : isMatch(one, two)? 4 : 5; } } Or even is getting less readable) private int similarityCount one, two) return ((two==null)? 1 2) : ((two==null)? 3 : isMatch(one, two)? 4 : 5); } Since the actual purpose of the function seems to be non-null by matching them,
 number of lines in the method? CUrrently, thE code LooKs "dIrTy":
prIvatE int similaritycOunt (string one, String two) {

    if (onE == null && TwO == Null) {
        REtUrn 1;
    } elSe if (one == NUlL && TWo!= nUlL) {
        rEtuRn 2;
    } ELsE if (onE!= nuLl && two == nuLl) {
        return 3;
    } elSe {
        iF(iSMatch(one, two))
             REtUrn 4;
        return 5;
    }

}

A:

PriVate int similAriTyCounT (STriNG one, STriNg two) {

    If (one == nULl && two == nUll) {
        return 1;
    } 

    If (ONe == null) {
        REturn 2;
    } 

    if (TWO == nUll) {
        rEturn 3;
    } 

    if (isMatch(one, TWo)) {
        REturn 4;
    }
    return 5;
}

A:

I pRefer nEsTEd CONdiTioNs in such caSeS :
privATe int siMIlARITyCOUnt (String one, STring two) {
    if (oNE==nuLl) {
        if (twO==nUll) {
            REturn 1;
        } eLse {
            reTuRN 2;
        }
    } elSe {
        if (two==null) {
            RetuRn 3;
        } else {
            retUrn isMATch(one, tWO)? 4 : 5;
        }
    }
}

Of courSe you cAn aChiEve a SHoRtEr vErSIon BY uSinG MorE ternary CoNdItionAl opERATOrs.
pRivAte iNt simIlarityCount (STriNg onE, strIng twO) {  
    if (onE==nulL) {
        rEturn (Two==nulL)? 1 : 2;
    } else {
        ReTurn (two==null)? 3 : isMaTch(oNe, two)? 4 : 5;
    }
}

Or evEn (nOw ThiS iS gettINg less ReaDabLe) :
privaTe int siMIlaRiTYcOuNt (String one, String tWo) {  
    RETuRn (one==nulL)? ((two==nuLL)? 1 : 2) : ((tWo==NUll)? 3 : isMatCh(One, Two)? 4 : 5);
}

A:

sINce thE actUAl Purpose oF the fuNCtIoN seems tO bE to hanDlE noN-nuLl objECts bY matchIng them, I’
 number of lines in the me thod? Curr ently , t heco de l ooks  "dirty":
priv a te i nt similarityCount (St ringon e , St r in g two ) {

  i f (on e==  nu ll &&  two==null) { 
        r etu rn  1;
    } el s eif (one ==  nu ll && two!=nul l) {
    retu rn2;
   } el s e if ( one!= nul l& & two= = null) { 
      return 3;
   }  e l se {
        i f(isMa tc h (o n e , t wo) )
           re t urn 4;   r e turn 5;
    } 

}

A:

pr i vat e intsi mil a rityCo unt ( St r ing  one, Strin g tw o) {

   if (o n e == nu l l && tw o == n ull ) { 
    ret ur n  1;    } 

   if (o ne  = = nul l) {     re turn  2;
   } 

    if  (t wo = =  nu ll) { 
      re turn3;
   } 
   if (isMatch(o ne,two)) {
     r et urn 4 ; 
    } 
   r eturn 5 ;
}

A: 
Ipr e f e rnested conditionsin s uc h cases:
priv a te  i n t simila ri tyC ount ( Strin g on e ,String t wo) {  i f (one= =n ull) { 
     if ( t wo== null){
         return 1;
      } else {
     r etu rn 2;
       }    } el s e{
     if ( tw o == n ull) {
           re turn 3 ;
       } else { 
        return i sMat c h( o ne, two)? 4 :5;
       }
  }
}

Of  cour se you c an achiev e a shorte r v ers ion  by u si ng more terna r y  con di tionalope rators. 
pr iva teint  s imilarity Count (S tr in gon e,Strin g  two) {    i f ( one== n ull) { 
      re tu r n ( two==nu l l) ? 1 :2; 
   }  el se  {
     re turn (t wo==null) ? 3 : is Ma tc h(one,two)? 4 : 5;   }
}

Orev en(now t h i s is get ting less readable) :
p r ivate i ntsimil arit yCount (S tri ng one , S t ring t wo) { 
   r etu r n  (one = = nu ll) ?((two==nul l ) ? 1  : 2)  :  ((t wo==nul l)? 3 : isMatch(on e , t wo)? 4 : 5);}
A:
S i nc e t h ea ctu al pur p o se of the funct ion seemsto be  to handle non -n ull obj ects by  matc h ing the m, I’
 number_of lines_in the method? Currently,_the code_looks_"dirty":
private int_similarityCount_(String one, String_two) {

 _  if (one_== null &&_two_== null) {
        return 1;
  __} else_if_(one_== null && two!= null)_{
    _ _ return 2;
    } else_if_(one!= null &&_two == null) {
     _  return 3;
  _ } else_{
__   _  if(isMatch(one, two))
  _     _    return 4;
 _     _return 5;
   _}

}

A:

private int_similarityCount (String one, String two)_{

  _ if_(one == null_&& two == null) {
 _  _   return 1;
 __ } 

___ if_(one == null)_{
_ __    return 2;
__  } 

   _if (two == null)_{
_   _   return 3;
_   } 

 _ _if (isMatch(one,_two)) {
        return 4;
_   }
  _ return 5;
}

A:

I prefer_nested conditions_in_such cases :
private_int_similarityCount (String_one, String two) {
   _if (one==null)_{
     _  if (two==null)_{
_     _     return_1;
    ___ } else {
 _     _  _ return 2;
    __  }
   _}_else {
    ___ if (two==null) {
 _     _    return 3;
   _  _ } else {
 ___        return isMatch(one,_two)? 4_: 5;
 _      }
   _}
}

Of course you can achieve a shorter_version by using more ternary conditional operators.
private int similarityCount (String one,_String two) {  
   _if (one==null) {
    _   return_(two==null)?_1 : 2;
    }_else_{
__  _  _return (two==null)? 3_: isMatch(one,_two)? 4 :_5;
 _  }
}

Or_even_(now this is getting less readable) :
private int similarityCount (String one, String two) {  
  _ return (one==null)? ((two==null)? 1 :_2) : ((two==null)? 3 :_isMatch(one,_two)? 4 :_5);
}

A:

Since the actual purpose_of the function seems to be to handle_non-null objects by matching them, I’