@VisibleForTesting Filters(Iterable<E> iterable) { this.initialIterable = iterable; // copy list to avoid modifying iterable this.filteredIterable = newArrayList(iterable); }
private boolean actualAndExpectedHaveSameStringRepresentation() { return areEqual(toStringOf(actual), toStringOf(expected)); }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(value); return result; }
@VisibleForTesting Doubles() { super(); }
private Object[] msgArgs(String description) { return array(description, toStringOf(expected), toStringOf(actual)); }
/** * Returns true if actual and other are equal based on {@link Object#equals(Object)}, false otherwise. * * @param actual the object to compare to other * @param other the object to compare to actual * @return true if actual and other are equal based on {@link Object#equals(Object)}, false otherwise. */ @Override public boolean areEqual(Object actual, Object other) { return Objects.areEqual(actual, other); }
private String asText(Object o) { if (o instanceof ComparatorBasedComparisonStrategy) { return " according to " + o + " comparator"; } if (o instanceof StandardComparisonStrategy) { return ""; } return toStringOf(o); } }
/** * Creates a new </code>{@link TextDescription}</code>. * * @param value the value of this description. * @throws NullPointerException if the given value is {@code null}. */ public TextDescription(String value) { checkNotNull(value); this.value = value; }
/** * Returns true if both date are in the same year, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year, false otherwise */ private static boolean areInSameYear(Date actual, Date other) { return yearOf(actual) == yearOf(other); }
@VisibleForTesting Shorts() { super(); }
/** * Returns <code>true</code> if given item is in given array, <code>false</code> otherwise. * @param item the object to look for in arrayOfValues * @param arrayOfValues the array of values * @return <code>true</code> if given item is in given array, <code>false</code> otherwise. */ private static boolean isItemInArray(Object item, Object[] arrayOfValues) { for (Object value : arrayOfValues) if (areEqual(value, item)) return true; return false; }
@Override public int hashCode() { return HASH_CODE_PRIME * 1 + hashCodeFor(value); }
@VisibleForTesting Bytes() { super(); }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(actual); result = HASH_CODE_PRIME * result + hashCodeFor(expected); return result; } }
@VisibleForTesting Longs() { super(); }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(key); result = HASH_CODE_PRIME * result + hashCodeFor(value); return result; }
@VisibleForTesting ArrayWrapperList(Object array) { this.array = array; }
@VisibleForTesting Properties(String propertyName, Class<T> propertyType) { this.propertyName = propertyName; this.propertyType = propertyType; }
@VisibleForTesting ShouldBeEqual(Object actual, Object expected, ComparisonStrategy comparisonStrategy) { this.actual = actual; this.expected = expected; this.comparisonStrategy = comparisonStrategy; }
@VisibleForTesting BigDecimals() { super(); }