code: public static int neighborsNumber(String[] neighbors)
      {
          int sum = 0;
          for (String s : neighbors)
          {
              if (s != null)
              {
                  sum++;
              }
          }
          return sum;
      }
docs: Count how many neighbors a key has
  
  @param neighbors the neighbors
  @return the number of neighbors