Mutant factory for constructing an instance with specified {@link PrettyPrinter},
and returning new instance (or, if there would be no change, this instance).
777880
public JSON with(PrettyPrinter pp)
    {
        if (_prettyPrinter == pp) {
            return this;
        }
        return _with(_features, _streamFactory, _treeCodec,
                _reader, _writer, pp);
    }
35215
static public ContentHandleFactory newFactory() {
    return new ContentHandleFactory() {
      @Override
      public Class<?>[] getHandledClasses() {
        return new Class<?>[]{ JsonParser.class };
      }
      @Override
      public boolean isHandled(Class<?> type) {
        return JsonParser.class.isAssignableFrom(type);
      }
      @Override
      public <C> ContentHandle<C> newHandle(Class<C> type) {
        @SuppressWarnings("unchecked")
        ContentHandle<C> handle = isHandled(type) ?
                                  (ContentHandle<C>) new JacksonParserHandle() : null;
        return handle;
      }
    };
  }
501980
public T newInstanceUsingCoercion(String... args) throws Throwable
    {
        Constructor<? extends T> constructor = ClassUtils.findPossibleConstructor(klass, args);
        Class[] types = constructor.getParameterTypes();
        return newInstance( TypeConversion.convert( args, types ) );
    }
403921
public static <T> T newInstance(Class<T> clazz) {
		try {
			return clazz.newInstance();
		}
		catch (InstantiationException | IllegalAccessException e) {
			throw new ResourceException(String.format("couldn't create a new instance of %s", clazz));
		}
	}
1168796
public static FormatFactory factory()
    {

        return new FormatFactory()
        {
            @Override
            public Format getFormat(String name, String args, Locale locale)
            {
                Map<String, Format> mt = FormatTables.get(name);
                Preconditions.checkArgument(mt != null, "There's no format instance for [%s]", name);

                Format m = mt.get((args == null || args.length() < 1) ? FormatNames.DEFAULT : args);
                Preconditions.checkArgument(m != null, "There's no signature in [%s] for the given args [%s]", name,
                        args);

                return ((ConfigurableFormat) m).withLocale(locale);
            }
        };

    }
1318718
@SuppressWarnings("unchecked")
	public T newInstance(ClassLoader classLoader) {
		try {
			return (T) compile(classLoader).getConstructor(Object[].class)
					// Because Constructor.newInstance(Object... initargs), we need to load
					// references into a new Object[], otherwise it cannot be compiled.
					.newInstance(new Object[] {references});
		} catch (Exception e) {
			throw new RuntimeException(
				"Could not instantiate generated class '" + className + "'", e);
		}
	}
732604
public static <F, T> OrikaCopier.Builder<F, T> createOrika(Class<F> sourceClass, Class<T> targetClass) {
        return new OrikaCopier.Builder<>(sourceClass, targetClass);
    }
1018240
protected function createPrinter()
    {
        if (defined('PHPUnit_TextUI_ResultPrinter::COLOR_AUTO') && defined('PHPUnit_TextUI_ResultPrinter::COLOR_NEVER')) {
            $shouldColor = $this->terminal->shouldColor() ? \PHPUnit_TextUI_ResultPrinter::COLOR_AUTO : \PHPUnit_TextUI_ResultPrinter::COLOR_NEVER;
        } else {
            $shouldColor = $this->terminal->shouldColor();
        }

        if ($this->hasDetailedProgress()) {
            $printer = new DetailedProgressPrinter(null, false, $shouldColor);
        } else {
            $printer = new ProgressPrinter(null, false, $shouldColor);
        }

        $printer->setRunner($this);

        return $printer;
    }
874673
public static <T> BeanCopier<T> create(Object source, T dest, Type destType, CopyOptions copyOptions) {
		return new BeanCopier<>(source, dest, destType, copyOptions);
	}
161730
public static Object createInstanceByType(Class<?> type, Object... args) throws Exception {
		if (args.length == 0) {
			Constructor<?> constructor = type.getConstructor();
			return constructor.newInstance();
		} else {
			throw new UnsupportedException(null, "NOT_SUPPORTED", "Constructors with parameters are not supported");
		}
	}
428011
private static <T> ServiceBindingBuilder<T> newFactoryBinder(final Factory<T> factory) {
        return BindingBuilderFactory.newFactoryBinder(factory);
    }
646402
static RequestCreator<JmxWriteRequest> newCreator() {
        return new RequestCreator<JmxWriteRequest>() {
            /** {@inheritDoc} */
            public JmxWriteRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
                return new JmxWriteRequest(
                        pStack.pop(), // object name
                        pStack.pop(), // attribute name
                        StringToObjectConverter.convertSpecialStringTags(pStack.pop()), // value
                        prepareExtraArgs(pStack), // path
                        pParams);
            }

            /** {@inheritDoc} */
            public JmxWriteRequest create(Map<String, ?> requestMap, ProcessingParameters pParams)
                    throws MalformedObjectNameException {
                return new JmxWriteRequest(requestMap,pParams);
            }
        };
    }
693739
public static ColorConverter newInstance(Configuration config, String[] options) {
		if (options.length < 1) {
			LOGGER.error("Incorrect number of options on style. "
					+ "Expected at least 1, received {}", options.length);
			return null;
		}
		if (options[0] == null) {
			LOGGER.error("No pattern supplied on style");
			return null;
		}
		PatternParser parser = PatternLayout.createPatternParser(config);
		List<PatternFormatter> formatters = parser.parse(options[0]);
		AnsiElement element = (options.length != 1) ? ELEMENTS.get(options[1]) : null;
		return new ColorConverter(formatters, element);
	}
1017652
public CachedWriter createWriter(boolean pretty) throws IOException {
		CachedWriter writer = new CachedWriter();
		writer.buffer = new ByteArrayOutputStream(512);
		writer.writer = IonBinaryWriterBuilder.standard().build(writer.buffer);
		return writer;
	}
776929
public static <T> T newObject(Class<T> clazz) {
        return getFactory(clazz).newObject(clazz);
    }
1035580
public static <T> OptionalBinder<T> newOptionalBinder(Binder binder, Class<T> type) {
    return new OptionalBinder<T>(
        newRealOptionalBinder(binder.skipSources(OptionalBinder.class), Key.get(type)));
  }
277312
static RequestCreator<JmxReadRequest> newCreator() {
        return new RequestCreator<JmxReadRequest>() {
            /** {@inheritDoc} */
            public JmxReadRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
                return new JmxReadRequest(
                        pStack.pop(),  // object name
                        popOrNull(pStack), // attribute(s) (can be null)
                        prepareExtraArgs(pStack), // path
                        pParams);
            }

            /** {@inheritDoc} */
            public JmxReadRequest create(Map<String, ?> requestMap, ProcessingParameters pParams)
                    throws MalformedObjectNameException {
                return new JmxReadRequest(requestMap,pParams);
            }
        };
    }