Code example for TreeMap

0
@SuppressWarnings("serial") 
public class CheckWithCheck extends AbstractAnnotationCheck<CheckWith> { 
 
    final static String mes = "validation.invalid";
 
    Map<String, String> variables = new TreeMap<String, String>();
    Check check;
 
    @Override 
    public void configure(CheckWith checkWith) {
        setMessage(checkWith.message());
        try { 
            Constructor<?> constructor = checkWith.value().getDeclaredConstructor();
            constructor.setAccessible(true);
            check = (Check)constructor.newInstance();
            check.checkWithCheck = this;
        } catch(Exception e) {
            throw new UnexpectedException(e);
        } 
    }