@Test public void getMillisForTimestampIfNotPunchedBeforeWhenLowerBoundIsNegative() { KeyValueService kvs = new InMemoryKeyValueService(false); puncherStore = initializePuncherStore(PUNCHER_HISTORY, kvs); assertThat(KeyValueServicePuncherStore .getMillisForTimestampIfNotPunchedBefore(kvs, TIMESTAMP_BETWEEN_1_AND_2, -100L)) .isEqualTo(WALL_CLOCK_1); }
public static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound) { if (get(kvs, Math.max(0L, lowerBound)) < timestamp) { return getMillisForTimestamp(kvs, timestamp); } else { return lowerBound; } }
KeyValueServicePuncherStore implements PuncherStore { public static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound) { if (get(kvs, Math.max(0L, lowerBound)) < timestamp) { return getMillisForTimestamp(kvs, timestamp); } else { return lowerBound; } } }
KeyValueServicePuncherStore implements PuncherStore { public static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound) { if (get(kvs, Math.max(0L, lowerBound)) < timestamp) { return getMillisForTimestamp(kvs, timestamp); } else { return lowerBound; } } private  KeyValueServicePuncherStore(KeyValueService keyValueService); }
KeyValueServicePuncherStore implements PuncherStore { public static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound) { if (get(kvs, Math.max(0L, lowerBound)) < timestamp) { return getMillisForTimestamp(kvs, timestamp); } else { return lowerBound; } } private  KeyValueServicePuncherStore(KeyValueService keyValueService); static PuncherStore create(KeyValueService keyValueService); static PuncherStore create(KeyValueService keyValueService, boolean initializeAsync); @Override boolean isInitialized(); @Override void put(long timestamp, long timeMillis); @Override Long get(Long timeMillis); static Long get(KeyValueService kvs, Long timeMillis); @Override long getMillisForTimestamp(long timestamp); static long getMillisForTimestamp(KeyValueService kvs, long timestamp); static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound); }
KeyValueServicePuncherStore implements PuncherStore { public static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound) { if (get(kvs, Math.max(0L, lowerBound)) < timestamp) { return getMillisForTimestamp(kvs, timestamp); } else { return lowerBound; } } private  KeyValueServicePuncherStore(KeyValueService keyValueService); static PuncherStore create(KeyValueService keyValueService); static PuncherStore create(KeyValueService keyValueService, boolean initializeAsync); @Override boolean isInitialized(); @Override void put(long timestamp, long timeMillis); @Override Long get(Long timeMillis); static Long get(KeyValueService kvs, Long timeMillis); @Override long getMillisForTimestamp(long timestamp); static long getMillisForTimestamp(KeyValueService kvs, long timestamp); static long getMillisForTimestampIfNotPunchedBefore(KeyValueService kvs, long timestamp, long lowerBound);  }