@Test void testSupplier2() { final Supplier<String> supplier = new DefaultIdentifierService().getSupplier(); final String id1 = supplier.get(); final String id2 = supplier.get(); assertNotEquals(id1, id2, "Suppliers shouldn't be equal!"); }
@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();  }