opermission/src/main/java/co/omkar/utility/opermission/dialog/PermissionDialogFragment.java
public static PermissionDialogFragment getInstance(PermBean bean, int requestCode) {
        if (bean == null) throw new NullPointerException("Permission Beans cannot be null !");
        Bundle extras = new Bundle(3);

        // convert map to two arrays.
        HashMap<Permission, String> map = (HashMap<Permission, String>) bean.getPermissions();

        // put arrays in extras.
        extras.putSerializable(PERMISSION, map);
        extras.putInt(REQUEST, requestCode);

        // set extras in fragment and return.
        PermissionDialogFragment fragment = new PermissionDialogFragment();
        fragment.setArguments(extras);
        return fragment;
    }
public static PermissionDialogFragment getInstance(PermBean bean, int requestCode) {
        if (bean == null) throw new NullPointerException("Permission Beans cannot be null !");
        Bundle extras = new Bundle(3);

        // convert map to two arrays.
        HashMap<Permission, String> map = (HashMap<Permission, String>) bean.getPermissions();

        // put arrays in extras.
        extras.putSerializable(PERMISSION, map);
        extras.putInt(REQUEST, requestCode);

        // set extras in fragment and return.
        PermissionDialogFragment fragment = new PermissionDialogFragment();
        fragment.setArguments(extras);
        return fragment;
    }
A static dialog fragment instance creator method.

@param bean        {@link PermBean}
@param requestCode any 16 bit {@link Integer} value.
@return new prepared instance of PermissionDialogFragment.