class ParametersFactory {

    public static Parameters selectPreviewSize(@NonNull Capabilities capabilities,
                                               @NonNull SelectorFunction<Collection<Size>, Size> selector) {
        return new Parameters().putValue(
                Parameters.Type.PREVIEW_SIZE,
                selector.select(
                        capabilities.supportedPreviewSizes()
                )
        );
    }

}