FederatedStoreUtil { public static List<String> getCleanStrings(final String value) { final List<String> values; if (value != null) { values = Lists.newArrayList(StringUtils.stripAll(value.split(SCHEMA_DEL_REGEX))); values.removeAll(STRINGS_TO_REMOVE); } else { values = null; } return values; } private  FederatedStoreUtil(); static String createOperationErrorMsg(final Operation operation, final String graphId, final Exception e); static List<String> getGraphIds(final Map<String, String> config); static List<String> getCleanStrings(final String value); static OP updateOperationForGraph(final OP operation, final Graph graph); static boolean isUserRequestingAdminUsage(final Operation operation); static final Collection<String> STRINGS_TO_REMOVE; }
@Test public void shouldGetNullStringsWhenNullCsv() { final String csv = null; final List<String> values = FederatedStoreUtil.getCleanStrings(csv); assertNull(values); }
@Test public void shouldGetEmptyStringsWhenEmptyCsv() { final String csv = ""; final List<String> values = FederatedStoreUtil.getCleanStrings(csv); assertEquals(Collections.emptyList(), values); }
@Test public void shouldGetCleanStrings() { final String csv = " 1,2, 3"; final List<String> values = FederatedStoreUtil.getCleanStrings(csv); assertEquals(Arrays.asList("1", "2", "3"), values); }
@Test public void shouldGetCleanStringsWithNoEmptiesAndWhitespace() { final String csv = ", 1 ,2 ,, 3, "; final List<String> values = FederatedStoreUtil.getCleanStrings(csv); assertEquals(Arrays.asList("1", "2", "3"), values); }