protected static Long max(Long l1,Long l2){
  if (l1 == null && l2 == null) {
    return null;
  }
  if (l2 == null) {
    return l1;
  }
  if (l1 == null) {
    return l2;
  }
  return Math.max(l1,l2);
}

protected static Long max ( Long l1 , Long l2 ) { if ( l1 == null && l2 == null ) { return null ; } if ( l2 == null ) { return l1 ; } if ( l1 == null ) { return l2 ; } return Math . max ( l1 , l2 ) ; }
utility method to return the maximum of two long values , either of which may be null .
