V2LibraryAliquotAliasGenerator implements NameGenerator<LibraryAliquot> { @Override public String generate(LibraryAliquot aliquot) throws MisoNamingException, IOException { if (!isDetailedLibraryAliquot(aliquot)) { throw new MisoNamingException("Can only generate an alias for detailed library aliquots"); } Library library = aliquot.getLibrary(); String partialAlias = library.getAlias() + "-"; int next = siblingNumberGenerator.getFirstAvailableSiblingNumber(LibraryAliquot.class, partialAlias); String siblingNumber = zeroPad(next, 2); return partialAlias + siblingNumber; }  void setSiblingNumberGenerator(SiblingNumberGenerator siblingNumberGenerator); @Override String generate(LibraryAliquot aliquot);  }
@Test public void testGenerate() throws Exception { testGenerate("TEST_0123_04_LB05", 6, "TEST_0123_04_LB05-06"); }