code: @Override
      @SuppressWarnings("unchecked")
      public K findMax() {
          switch (size) {
          case 0:
              throw new NoSuchElementException();
          case 1:
              return array[1];
          case 2:
              return array[2];
          default:
              if (comparator == null) {
                  if (((Comparable<? super K>) array[3]).compareTo(array[2]) > 0) {
                      return array[3];
                  } else {
                      return array[2];
                  }
              } else {
                  if (comparator.compare(array[3], array[2]) > 0) {
                      return array[3];
                  } else {
                      return array[2];
                  }
              }
          }
      }
docs: {@inheritDoc}