return new BaseMatcher<ResourcesPerDay>() {
@Override
public boolean matches(Object arg) {
if (arg instanceof ResourcesPerDay) {
ResourcesPerDay r = (ResourcesPerDay) arg;
return r.getAmount().intValue() == integerPart
&& getDecimalPart(r) == decimalPart;
}
return false;
}
private int getDecimalPart(ResourcesPerDay r) {
BigDecimal onlyDecimal = r.getAmount().subtract(
new BigDecimal(r.getAmount().intValue()));
BigDecimal decimalPartAsInt = onlyDecimal.movePointRight(4);
int result = decimalPartAsInt.intValue();
return result;
}