DefaultBindingErrorMessageProvider provider = new DefaultBindingErrorMessageProvider();
assertEquals("typeMismatch", provider.getMessageCodeForException(new TypeMismatchException(new Object(),
String.class)));
assertEquals("required", provider.getMessageCodeForException(new NullPointerException()));
assertEquals("typeMismatch", provider.getMessageCodeForException(new InvalidFormatException("", "")));
assertEquals("typeMismatch", provider.getMessageCodeForException(new IllegalArgumentException()));
assertEquals("required", provider.getMessageCodeForException(new RuntimeException(new NullPointerException())));
assertEquals("unknown", provider.getMessageCodeForException(new UnsupportedOperationException()));
}