public void assertError(String beanName, Type type, Object valueA, Object valueB) throws ComparisonException {
Result result = assertError(beanName, type);
if (EqualsUtils.objectsNotEqual(valueA, result.getValueA())) {
String expectedName = ReflectUtils.getName(valueA);
String actualName = ReflectUtils.getName(result.getValueA());
String msg = String.format("Value A is not \"%s\" (%s) as expected but rather \"%s\" (%s).", valueA, expectedName, result.getValueA(), actualName);
throw new ComparisonException(msg);
}
if (EqualsUtils.objectsNotEqual(valueB, result.getValueB())) {
String expectedName = ReflectUtils.getName(valueB);
String actualName = ReflectUtils.getName(result.getValueB());
String msg = String.format("Value B is not \"%s\" (%s) as expected but rather \"%s\" (%s).", valueB, expectedName, result.getValueB(), actualName);
throw new ComparisonException(msg);
}
}