code: @SuppressWarnings("unchecked")
      public static <T extends Type> Type decodeIndexedValue(
              String rawInput, TypeReference<T> typeReference) {
          String input = Numeric.cleanHexPrefix(rawInput);
  
          try {
              Class<T> type = typeReference.getClassType();
  
              if (Bytes.class.isAssignableFrom(type)) {
                  return TypeDecoder.decodeBytes(input, (Class<Bytes>) Class.forName(type.getName()));
              } else if (Array.class.isAssignableFrom(type)
                      || BytesType.class.isAssignableFrom(type)
                      || Utf8String.class.isAssignableFrom(type)) {
                  return TypeDecoder.decodeBytes(input, Bytes32.class);
              } else {
                  return TypeDecoder.decode(input, type);
              }
          } catch (ClassNotFoundException e) {
              throw new UnsupportedOperationException("Invalid class reference provided", e);
          }
      }
docs: <p>Decodes an indexed parameter associated with an event. Indexed parameters are individually
  encoded, unlike non-indexed parameters which are encoded as per ABI-encoded function
  parameters and return values.</p>
  
  <p>If any of the following types are indexed, the Keccak-256 hashes of the values are
  returned instead. These are returned as a bytes32 value.</p>
  
  <ul>
  <li>Arrays</li>
  <li>Strings</li>
  <li>Bytes</li>
  </ul>
  
  <p>See the
  <a href="http://solidity.readthedocs.io/en/latest/contracts.html#events">
  Solidity documentation</a> for further information.</p>
  
  @param rawInput ABI encoded input
  @param typeReference of expected result type
  @param <T> type of TypeReference
  @return the decode value