### Question:
AwsStackRequestHelper { @VisibleForTesting void addParameterChunks(Collection<Parameter> parameters, String baseParameterKey, String parameterValue, int chunkCount) { int chunk = 0; String parameterKey = baseParameterKey; if (parameterValue == null) { parameters.add(new Parameter().withParameterKey(parameterKey).withParameterValue(null)); } else { int len = parameterValue.length(); int offset = 0; int limit = CHUNK_SIZE; while ((chunk < chunkCount) && (len > limit)) { parameters.add(new Parameter().withParameterKey(parameterKey).withParameterValue(parameterValue.substring(offset, limit))); chunk++; parameterKey = baseParameterKey + chunk; offset = limit; limit += CHUNK_SIZE; } parameters.add(new Parameter().withParameterKey(parameterKey).withParameterValue(parameterValue.substring(offset, len))); } while (++chunk < chunkCount) { parameterKey = baseParameterKey + chunk; parameters.add(new Parameter().withParameterKey(parameterKey).withParameterValue("")); } }  CreateStackRequest createCreateStackRequest(AuthenticatedContext ac, CloudStack stack, String cFStackName, String subnet, String cfTemplate); CreateStackRequest createCreateStackRequest(AuthenticatedContext ac, DatabaseStack stack, String cFStackName, String cfTemplate); UpdateStackRequest createUpdateStackRequest(AuthenticatedContext ac, CloudStack stack, String cFStackName, String cfTemplate); DeleteStackRequest createDeleteStackRequest(String cFStackName);  }### Answer:
@Test public void testAddParameterChunks() { int chunkSize = AwsStackRequestHelper.CHUNK_SIZE; String baseParameterKey = RandomStringUtils.random(20); int len = 2 * chunkSize; String bigParameterValue = RandomStringUtils.random(len); String chunk0 = bigParameterValue.substring(0, chunkSize); String key1 = baseParameterKey + "1"; String chunk1 = bigParameterValue.substring(chunkSize, len); String key2 = baseParameterKey + "2"; Collection<Parameter> parameters = new ArrayList<>(); underTest.addParameterChunks(parameters, baseParameterKey, bigParameterValue, 3); assertContainsParameter(parameters, baseParameterKey, chunk0); assertContainsParameter(parameters, key1, chunk1); assertContainsParameter(parameters, key2, ""); parameters = new ArrayList<>(); underTest.addParameterChunks(parameters, baseParameterKey, bigParameterValue.substring(0, len - 1), 3); assertContainsParameter(parameters, baseParameterKey, chunk0); assertContainsParameter(parameters, key1, chunk1.substring(0, chunkSize - 1)); assertContainsParameter(parameters, key2, ""); parameters = new ArrayList<>(); underTest.addParameterChunks(parameters, baseParameterKey, "", 3); assertContainsParameter(parameters, baseParameterKey, ""); assertContainsParameter(parameters, key1, ""); assertContainsParameter(parameters, key2, ""); parameters = new ArrayList<>(); underTest.addParameterChunks(parameters, baseParameterKey, null, 3); assertContainsParameter(parameters, baseParameterKey, null); assertContainsParameter(parameters, key1, ""); assertContainsParameter(parameters, key2, ""); }