@Test void testSupplier() { final String prefix = "trellis:data/"; final Supplier<String> supplier = new DefaultIdentifierService().getSupplier(prefix); final String id1 = supplier.get(); final String id2 = supplier.get(); assertTrue(id1.startsWith(prefix), WRONG_PREFIX); assertTrue(id2.startsWith(prefix), WRONG_PREFIX); assertNotEquals(id1, id2, "Generated ids shouldn't match!"); }
@Override public Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length) { requireNonNull(prefix, "The Id prefix may not be null!"); return () -> getId(prefix, hierarchy, length); }
DefaultIdentifierService implements IdentifierService { @Override public Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length) { requireNonNull(prefix, "The Id prefix may not be null!"); return () -> getId(prefix, hierarchy, length); } }
DefaultIdentifierService implements IdentifierService { @Override public Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length) { requireNonNull(prefix, "The Id prefix may not be null!"); return () -> getId(prefix, hierarchy, length); } DefaultIdentifierService();  DefaultIdentifierService(final String prefix); }
DefaultIdentifierService implements IdentifierService { @Override public Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length) { requireNonNull(prefix, "The Id prefix may not be null!"); return () -> getId(prefix, hierarchy, length); } DefaultIdentifierService();  DefaultIdentifierService(final String prefix); @Override Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length); @Override Supplier<String> getSupplier(final String prefix); @Override Supplier<String> getSupplier(); }
DefaultIdentifierService implements IdentifierService { @Override public Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length) { requireNonNull(prefix, "The Id prefix may not be null!"); return () -> getId(prefix, hierarchy, length); } DefaultIdentifierService();  DefaultIdentifierService(final String prefix); @Override Supplier<String> getSupplier(final String prefix, final int hierarchy, final int length); @Override Supplier<String> getSupplier(final String prefix); @Override Supplier<String> getSupplier();  }