class ConvertToString implements Function<Object, String> {

    private final Supplier<? extends RuntimeException> supplier;

    /**
     * Constructor
     *
     * @param supplier supplier
     */
    public ConvertToString(Supplier<? extends RuntimeException> supplier) {
        Precondition.notNull(supplier);
        this.supplier = supplier;
    }

    /**
     * Method to apply a function
     *
     * @param value value
     * @return the return value
     */
    @Override
    public String apply(Object value) {<FILL_FUNCTION_BODY>}
}

        if (value == null) {
            throw new IllegalArgumentException();
        }

        try {
            return (String) value;
        } catch (Throwable t) {
            throw supplier.get();
        }
    
<no_super_class>