public SocketAddress createSocketAddress(final Path socketPath) {
        if (!isAvailable()) {
            throw new UnsupportedOperationException("Unix Domain Socket support is not available");
        }
        Args.notNull(socketPath, "Unix domain socket path");

        try {
            if (IMPLEMENTATION == Implementation.JDK) {
                // JDK implementation
                final Class<?> addressClass = Class.forName(JDK_UNIX_SOCKET_ADDRESS_CLASS);
                final Method ofMethod = addressClass.getMethod("of", Path.class);
                return (SocketAddress) ofMethod.invoke(null, socketPath);
            } else {
                // JUnixSocket implementation
                final Class<?> addressClass = Class.forName(JUNIXSOCKET_ADDRESS_CLASS);
                final Method ofMethod = addressClass.getMethod("of", Path.class);
                return (SocketAddress) ofMethod.invoke(null, socketPath);
            }
        } catch (final ReflectiveOperationException ex) {
            throw new RuntimeException("Could not create UDS SocketAddress", ex);
        }
    }
Gets the singleton instance of {@link UnixDomainSocketFactory}.

@return the singleton instance
httpclient5/src/main/java/org/apache/hc/client5/http/socket/UnixDomainSocketFactory.java