@Test public void testGenerateNextSgt_withinLimits() throws Exception { sgts.add(new Sgt(10)); final Optional<Sgt> sgt = generator.generateNextSgt(templateDao); Assert.assertTrue(sgt.isPresent()); Assert.assertEquals(11, sgt.get().getValue().intValue()); }
public java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache) { return sgtRange.flatMap(range -> findTopUsedSgt(templateCache.keySet(), range.lowerEndpoint()) .map(topUsedSgt -> incrementSafely(range, topUsedSgt)) ); }
SgtGeneratorImpl { public java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache) { return sgtRange.flatMap(range -> findTopUsedSgt(templateCache.keySet(), range.lowerEndpoint()) .map(topUsedSgt -> incrementSafely(range, topUsedSgt)) ); } }
SgtGeneratorImpl { public java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache) { return sgtRange.flatMap(range -> findTopUsedSgt(templateCache.keySet(), range.lowerEndpoint()) .map(topUsedSgt -> incrementSafely(range, topUsedSgt)) ); } SgtGeneratorImpl(final SgtGeneratorConfig sgtGenerator); }
SgtGeneratorImpl { public java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache) { return sgtRange.flatMap(range -> findTopUsedSgt(templateCache.keySet(), range.lowerEndpoint()) .map(topUsedSgt -> incrementSafely(range, topUsedSgt)) ); } SgtGeneratorImpl(final SgtGeneratorConfig sgtGenerator); java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache); }
SgtGeneratorImpl { public java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache) { return sgtRange.flatMap(range -> findTopUsedSgt(templateCache.keySet(), range.lowerEndpoint()) .map(topUsedSgt -> incrementSafely(range, topUsedSgt)) ); } SgtGeneratorImpl(final SgtGeneratorConfig sgtGenerator); java.util.Optional<Sgt> generateNextSgt(SimpleCachedDao<Sgt, EndpointPolicyTemplateBySgt> templateCache);  }