@Override
    public KeyMetadata metadata() {
      return new KeyMetadata() {

        @Override
        public boolean isExpression() {
          return false;
        }

        @Override
        public List<Expression> keys() {
          throw new UnsupportedOperationException("This extractor is defined for generic java function. " +
                  "Key AST (as Expression) is unknown for " + entityType.getName()
                  + " by current " + Generic.class.getSimpleName() + " extractor. Did you check isExpression() ?");
        }

        @Override
        public boolean isKeyDefined() {
          return true;
        }
      };
    }
Extractor based on generic {@link Function}. Does not contain any key expression metadata
criteria/common/src/org/immutables/criteria/backend/KeyExtractors.java