UserIdMdcHelper { public static boolean isSet() { String userId = MDC.get(KEY); return !(Strings.isNullOrEmpty(userId) || UNKNOWN.equals(userId)); } private  UserIdMdcHelper(); static boolean isSet(); static void setIfNeeded(); static void set(final Subject subject); static void set(); static void unknown(); static void system(); static void unset(); static final String KEY; }
@Test public void isSet() { MDC.put(KEY, "test"); assertThat(UserIdMdcHelper.isSet(), is(true)); }
@Test public void isSet_withNull() { String value = MDC.get(KEY); assertThat(value, nullValue()); assertThat(UserIdMdcHelper.isSet(), is(false)); }
@Test public void isSet_withBlank() { MDC.put(KEY, ""); assertThat(UserIdMdcHelper.isSet(), is(false)); }
@Test public void isSet_withUnknown() { MDC.put(KEY, UNKNOWN); assertThat(UserIdMdcHelper.isSet(), is(false)); }