code: public final void setSNIMatchers(Collection<SNIMatcher> matchers) {
          if (matchers != null) {
              if (!matchers.isEmpty()) {
                  sniMatchers = new HashMap<>(matchers.size());
                  for (SNIMatcher matcher : matchers) {
                      if (sniMatchers.put(matcher.getType(),
                                                  matcher) != null) {
                          throw new IllegalArgumentException(
                                      "Duplicated server name of type " +
                                      matcher.getType());
                      }
                  }
              } else {
                  sniMatchers = Collections.<Integer, SNIMatcher>emptyMap();
              }
          } else {
              sniMatchers = null;
          }
      }
docs: Sets the {@link SNIMatcher}s of the Server Name Indication (SNI)
  parameter.
  <P>
  This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s
  operating in server mode.
  <P>
  Note that the {@code matchers} collection is cloned to protect
  against subsequent modification.
  
  @param  matchers
  the collection of {@link SNIMatcher}s (or null)
  
  @throws NullPointerException if the {@code matchers}
  contains {@code null} element
  @throws IllegalArgumentException if the {@code matchers}
  contains more than one name of the same name type
  
  @see Collection
  @see SNIMatcher
  @see #getSNIMatchers()
  
  @since 1.8