package com.grahamedgecombe.tinybasic.tokenizer;

public final class Token {

    private static final String EMPTY_STRING = "";

    public enum Type {
        EOF,
        LF,
        VAR,
        KEYWORD,
        NUMBER,
        STRING,
        OP_PLUS,
        OP_MINUS,
        OP_MULT,
        OP_DIV,
        LPAREN,
        RPAREN,
        OP_EQ,
        OP_NE,
        OP_GT,
        OP_GTE,
        OP_LT,
        OP_LTE,
        COMMA
    }

    private final Type type;
    private final String value;

    public Token(Type type) {
        this.type = type;
        this.value = EMPTY_STRING;
    }

    public Token(Type type, String value) {
        this.type = type;
        this.value = value;
    }

    public Type getType() {
        return type;
    }

    public String getValue() {
        return value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Token token = (Token) o;

        if (type != token.type) return false;
        if (!value.equals(token.value)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = type.hashCode();
        result = 31 * result + value.hashCode();
        return result;
    }

}

@@ -43,16 +43,43 @@
 nizer;%0A%0A
+import java.util.Objects;%0A%0A
 public f
@@ -1227,108 +1227,182 @@
     
-int result = type.hashCode(
+return Objects.hash(type, value
 );%0A    
+%7D%0A%0A
     
-result = 31 * result + value.hashCode();%0A        return result
+@Override%0A    public String toString() %7B%0A        return Token.class.getSimpleName() + %22 %5Btype=%22 + type + %22, value=%22 + value + %22%5D%22
 ;%0A  

Add Token.toString() and use Objects.hash() in Token.hashCode().