@Override public @NonNull List<ResolveInfo> queryIntentServices(final Intent intent, final int flags) {
					final List<ResolveInfo> resolves = new ArrayList<>();
					final String ime = Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
					if (ime != null) try {
						final String ime_pkg = requireNonNull(ComponentName.unflattenFromString(ime)).getPackageName();
						final int uid = getPackageManager().getPackageUid(ime_pkg, 0);
						resolves.add(buildResolveInfo("bg.service.1", 999999999));		// Simulate a background UID.
						resolves.add(buildResolveInfo("non.bg.service", uid));
						resolves.add(buildResolveInfo("bg.service.2", 88888888));
					} catch (final NameNotFoundException ignored) {}	// Should hardly happen
					return resolves;
				}
Miscellaneous test cases

Created by Oasis on 2017/4/10.
library/src/androidTest/java/com/oasisfeng/condom/CondomMiscTest.java