I have the following class:
package query;
public class Predicate<T> {
    private String operand1; 
    private String operator; 
    private T operand2; 
    private Class<T> classType; 
    public Predicate(String operand1, T operand2, Class<T> classType){
        this(operand1, "=", operand2, classType); 
    }
    public Predicate(String operand1, String operator, T operand2, Class<T> classType){
        this.operand1 = operand1; 
        this.operator = operator; 
        this.operand2 = operand2; 
        this.classType = classType; 
    }
    public String getOperand1() {
        return operand1;
    }
    public String getOperator() {
        return operator;
    }
    public T getOperand2() {
        return operand2;
    }
    public Class<T> getClassType() {
        return classType;
    }
    @Override
    public String toString() {
        return operand1 + " " + operator + " ?"; 
    }
}
The following line compiles fine:
Predicate<String> p1 = new Predicate<>("given_name", "=", "Kim", String.class); 
However, the following does not:
Predicate<Integer> p1 = new Predicate<>("id", "=", "1", Integer.class); 
The compiler mentions: Cannot infer type arguments for Predicate<>
What is wrong / how can solve this?