class JsonUtils {

    @SuppressWarnings({"unchecked"})
    public static <T> T createProxy(Class<T> anInterface) {
        if (anInterface == null) {
            throw new IllegalArgumentException();
        }
        if (anInterface.isInterface()) {
            return (T)Proxy.newProxyInstance(anInterface.getClassLoader(), new Class[]{anInterface}, new ProxyObject(anInterface));
        }
        throw new IllegalArgumentException(String.format("Type '%s' is not interface. ", anInterface.getSimpleName()));
    }

    private  JsonUtils();

}