@Test public void shouldResultEmptyPackageNameForInvalidDataString() { val resultForNull = IntentUtils.packageNameFrom(null); assertThat(resultForNull, is("")); val resultForEmpty = IntentUtils.packageNameFrom(""); assertThat(resultForEmpty, is("")); val resultForInvalidFormat = IntentUtils.packageNameFrom("com.abc"); assertThat(resultForInvalidFormat, is("")); }
@NonNull public static String packageNameFrom(final String intentDataString) { val dataArray = nullToEmpty(intentDataString).split(":"); return (dataArray.length == 2) ? dataArray[1] : ""; }
IntentUtils { @NonNull public static String packageNameFrom(final String intentDataString) { val dataArray = nullToEmpty(intentDataString).split(":"); return (dataArray.length == 2) ? dataArray[1] : ""; } }
IntentUtils { @NonNull public static String packageNameFrom(final String intentDataString) { val dataArray = nullToEmpty(intentDataString).split(":"); return (dataArray.length == 2) ? dataArray[1] : ""; } private  IntentUtils(); }
IntentUtils { @NonNull public static String packageNameFrom(final String intentDataString) { val dataArray = nullToEmpty(intentDataString).split(":"); return (dataArray.length == 2) ? dataArray[1] : ""; } private  IntentUtils(); @NonNull static String packageNameFrom(final String intentDataString); }
IntentUtils { @NonNull public static String packageNameFrom(final String intentDataString) { val dataArray = nullToEmpty(intentDataString).split(":"); return (dataArray.length == 2) ? dataArray[1] : ""; } private  IntentUtils(); @NonNull static String packageNameFrom(final String intentDataString);  }