private IntrospectedType optionalParameter() {
      if (isNullable()) {
        return withType(type);
      }

      final String typeName = erasure.toString();
      final TypeMirror newType;
      if ("java.util.OptionalInt".equals(typeName)) {
        newType = elements.getTypeElement(Integer.class.getName()).asType();
      } else if ("java.util.OptionalLong".equals(typeName)) {
        newType = elements.getTypeElement(Long.class.getName()).asType();
      } else if ("java.util.OptionalDouble".equals(typeName)) {
        newType = elements.getTypeElement(Double.class.getName()).asType();
      } else if ("java.util.Optional".equals(typeName)
          || "com.google.common.base.Optional".equals(typeName)
          || "io.atlassian.fugue.Option".equals(typeName)) {
        newType = MoreTypes.asDeclared(type).getTypeArguments().get(0);
      } else {
        throw new IllegalArgumentException(String.format("%s is not an optional type", type));
      }

      return withType(newType);
    }
Creates several matchers programmatically based on {@link ValueAttribute}.
{@code StringMatcher}, {@code WithMatcher}, {@code NotMatcher} etc.
value-processor/src/org/immutables/value/processor/meta/CriteriaModel.java