@Test public void test_stripe_dic_exhausted() throws IOException { Cluster cluster = newTestCluster("foo"); try (Stream<String> lines = Files.lines(Paths.get("src/main/resources/dict/animals.txt"))) { lines .map(name -> newTestStripe(name, UID.newUID())) .forEach(cluster::addStripe); } cluster.addStripe(newTestStripe("stripe-1", UID.newUID())); cluster.addStripe(newTestStripe("stripe-2", UID.newUID())); Stripe newStripe = newTestStripe(STRIPE_NAME.getDefaultValue(), UID.newUID()); cluster.addStripe(newStripe); NameGenerator.assignFriendlyNames(cluster, newStripe.getUID()); assertThat(newStripe.getName(), is(equalTo("stripe-3"))); new ClusterValidator(cluster).validate(); }
public static void assignFriendlyNames(Cluster cluster) { cluster.getStripes().forEach(stripe -> assignFriendlyNames(cluster, stripe.getUID())); }
NameGenerator { public static void assignFriendlyNames(Cluster cluster) { cluster.getStripes().forEach(stripe -> assignFriendlyNames(cluster, stripe.getUID())); } }
NameGenerator { public static void assignFriendlyNames(Cluster cluster) { cluster.getStripes().forEach(stripe -> assignFriendlyNames(cluster, stripe.getUID())); }  }
NameGenerator { public static void assignFriendlyNames(Cluster cluster) { cluster.getStripes().forEach(stripe -> assignFriendlyNames(cluster, stripe.getUID())); }  static void assignFriendlyNames(Cluster cluster); static void assignFriendlyNames(Cluster cluster, UID stripeUID); static void assignFriendlyNodeName(Cluster cluster, UID nodeUID); static void assignFriendlyStripeNames(Cluster cluster, Random random); }
NameGenerator { public static void assignFriendlyNames(Cluster cluster) { cluster.getStripes().forEach(stripe -> assignFriendlyNames(cluster, stripe.getUID())); }  static void assignFriendlyNames(Cluster cluster); static void assignFriendlyNames(Cluster cluster, UID stripeUID); static void assignFriendlyNodeName(Cluster cluster, UID nodeUID); static void assignFriendlyStripeNames(Cluster cluster, Random random);  }