class DefaultSlingSimulator implements SlingSimulatorBackend, SlingSimulator {

    static @Nullable OsgiConfigInstallableParams maybeConfigResource(final @NotNull NodeRes resource) {
        final String lastIdPart = getResourceId(resource.getPath());

        // remove extension if known
        final String pid = removeConfigExtension(lastIdPart);

        // split pid and factory pid alias
        final String factoryPid;
        final String configPid;
        int n = pid.indexOf('~');
        if (n == -1) {
            n = pid.indexOf('-');
        }
        if (n > 0) {
            configPid = pid.substring(n + 1);
            factoryPid = pid.substring(0, n);
        } else {
            factoryPid = null;
            configPid = pid;
        }

        return new OsgiConfigInstallableParams(resource.getProps(), configPid,
                factoryPid, resource.getParseError());
    }

}