StringFunctions { public synchronized static Stack<Integer> getStack(Integer minId, Integer maxId, String exclusions, boolean include) { String key = getStackKey(minId, maxId, exclusions, include); Stack<Integer> stack = stackMap.get(key); if (stack == null) { int blockSize = (maxId - minId) / APITestHarness.getInstance().getAgentRunData().getTotalAgents(); int offset = APITestHarness.getInstance().getAgentRunData().getAgentInstanceNum() * blockSize; LOG.info(LogUtil.getLogMessage("Creating userId Block starting at " + (offset + minId) + " and containing " + blockSize + " entries with " + (include ? "inclusion" : "exclusion") + " pattern(s) of " + exclusions, LogEventType.System)); List<Integer> list; List<String> exclusionList = parseExclusions(exclusions); list = IntStream.range(0, blockSize).map(i -> i + minId + offset).filter(nextNum -> nextNum < maxId).filter(nextNum -> shouldInclude(Integer.toString(nextNum), exclusionList, include)).boxed().collect(Collectors.toList()); Collections.shuffle(list); stack = new Stack<Integer>(); stack.addAll(list); stackMap.put(key, stack); } return stack; }  static boolean isValid(String[] values); static String executeFunction(String[] values, Variables variables, String addtlString); synchronized static Stack<Integer> getStack(Integer minId, Integer maxId, String exclusions, boolean include); static boolean shouldInclude(String value, List<String> expressions, boolean include);  }
@Test public void testGetStack_1() throws Exception { Integer minId = Integer.valueOf(1); Integer maxId = Integer.valueOf(1); String exclusions = ""; boolean include = true; Stack<Integer> result = StringFunctions.getStack(minId, maxId, exclusions, include); assertNotNull(result); }
@Test public void testGetStack_2() throws Exception { Integer minId = Integer.valueOf(1); Integer maxId = Integer.valueOf(1); String exclusions = ""; boolean include = false; Stack<Integer> result = StringFunctions.getStack(minId, maxId, exclusions, include); assertNotNull(result); }
@Test public void testGetStack_3() throws Exception { Integer minId = Integer.valueOf(1); Integer maxId = Integer.valueOf(1); String exclusions = ""; boolean include = true; Stack<Integer> result = StringFunctions.getStack(minId, maxId, exclusions, include); assertNotNull(result); }
@Test public void testGetStack_4() throws Exception { Integer minId = Integer.valueOf(1); Integer maxId = Integer.valueOf(1); String exclusions = ""; boolean include = true; Stack<Integer> result = StringFunctions.getStack(minId, maxId, exclusions, include); assertNotNull(result); }
@Test public void testGetStack_5() throws Exception { Integer minId = new Integer(1); Integer maxId = new Integer(1); String exclusions = ""; boolean include = true; Stack<Integer> result = StringFunctions.getStack(minId, maxId, exclusions, include); assertNotNull(result); }