private E newInstance(PathMetadata<?> pm) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { if (constructor == null) { if (Constants.isTyped(queryType)) { constructor = queryType.getConstructor(Class.class, PathMetadata.class); } else { constructor = queryType.getConstructor(PathMetadata.class); } } if (Constants.isTyped(queryType)) { return constructor.newInstance(getValueType(), pm); } else { return constructor.newInstance(pm); } }