private Address computeSingleTarget(Collection<Address> targets, List<Address> localMembers, int membersSize,
                                       boolean broadcast, boolean totalOrder) {
      Address singleTarget;
      if (broadcast || totalOrder) {
         singleTarget = null;
      } else {
         if (targets == null) {
            // No broadcast means we eliminated the membersSize == 1 and membersSize > 2 possibilities
            assert membersSize == 2;
            singleTarget = localMembers.get(0).equals(address) ? localMembers.get(1) : localMembers.get(0);
         } else if (targets.size() == 1) {
            singleTarget = targets.iterator().next();
         } else {
            singleTarget = null;
         }
      }
      return singleTarget;
   }
private Address computeSingleTarget ( Collection < Address > targets , List < Address > localMembers , int membersSize , boolean broadcast , boolean totalOrder ) { Address singleTarget ; if ( broadcast || totalOrder ) { singleTarget = null ; } else { if ( targets == null ) { assert membersSize == 2 ; singleTarget = localMembers . get ( 0 ) . equals ( address ) ? localMembers . get ( 1 ) : localMembers . get ( 0 ) ; } else if ( targets . size ( ) == 1 ) { singleTarget = targets . iterator ( ) . next ( ) ; } else { singleTarget = null ; } } return singleTarget ; }
@return The single target's address, or {@code null} if there are multiple targets.