/**
 * This exception represents two given lengths are not matched.
 */
public class LengthUnmatchedException extends Exception{
    public LengthUnmatchedException(String s){
        super(s);
    }
}

Create LengthUnmatchedException class.