### Question:
DynamoDBLeaseTaker implements LeaseTaker { static String stringJoin(Collection<String> strings, String delimiter) { StringBuilder builder = new StringBuilder(); boolean needDelimiter = false; for (String string : strings) { if (needDelimiter) { builder.append(delimiter); } builder.append(string); needDelimiter = true; } return builder.toString(); } DynamoDBLeaseTaker(LeaseRefresher leaseRefresher, String workerIdentifier, long leaseDurationMillis,
            final MetricsFactory metricsFactory); DynamoDBLeaseTaker withMaxLeasesForWorker(int maxLeasesForWorker); DynamoDBLeaseTaker withVeryOldLeaseDurationNanosMultipler(long veryOldLeaseDurationNanosMultipler); DynamoDBLeaseTaker withMaxLeasesToStealAtOneTime(int maxLeasesToStealAtOneTime); @Override Map<String, Lease> takeLeases(); @Override String getWorkerIdentifier(); @Override synchronized List<Lease> allLeases();  }### Answer:
@Test public final void testStringJoin() { List<String> strings = new ArrayList<>(); strings.add("foo"); Assert.assertEquals("foo", DynamoDBLeaseTaker.stringJoin(strings, ", ")); strings.add("bar"); Assert.assertEquals("foo, bar", DynamoDBLeaseTaker.stringJoin(strings, ", ")); }