Rename jee7schedule -> jee7

This commit is contained in:
Grzegorz Piwowarek
2016-10-23 19:13:21 +02:00
parent 9055ecbc6f
commit 90ca609762
20 changed files with 14 additions and 21 deletions
@@ -0,0 +1,30 @@
package com.baeldung.timer;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
class WithinWindowMatcher extends BaseMatcher<Long> {
private final long timeout;
private final long tolerance;
public WithinWindowMatcher(long timeout, long tolerance) {
this.timeout = timeout;
this.tolerance = tolerance;
}
@Override
public boolean matches(Object item) {
final Long actual = (Long) item;
return Math.abs(actual - timeout) < tolerance;
}
@Override
public void describeTo(Description description) {
//To change body of implemented methods use File | Settings | File Templates.
}
public static Matcher<Long> withinWindow(final long timeout, final long tolerance) {
return new WithinWindowMatcher(timeout, tolerance);
}
}