package org.bukkit.support; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; public final class Matchers { private Matchers() {} public static Matcher sameHash(T value) { return new SameHash(value); } static class SameHash extends BaseMatcher { private final int expected; SameHash(T object) { expected = object.hashCode(); } public boolean matches(Object item) { return item.hashCode() == expected; } public void describeTo(Description description) { description.appendValue(expected); } } }