code: public EncodingState getEncodingStateFor(CharSequence string) {
          int identityHashCode = System.identityHashCode(string);
          Set<Encoder> result = null;
          for (Map.Entry<Encoder, Set<Integer>> entry : encodingTagIdentityHashCodes.entrySet()) {
              if (entry.getValue().contains(identityHashCode)) {
                  if (result == null) {
                      result = Collections.singleton(entry.getKey());
                  }
                  else {
                      if (result.size() == 1) {
                          result = new HashSet<Encoder>(result);
                      }
                      result.add(entry.getKey());
                  }
              }
          }
          return result != null ? new EncodingStateImpl(result, null) : EncodingStateImpl.UNDEFINED_ENCODING_STATE;
      }
docs: /* (non-Javadoc)
  @see EncodingStateRegistry#getEncodingStateFor(java.lang.CharSequence)