I think what Enes meant is, comparison of BINARY and CACHED formats should be the same;

````java
switch (inMemoryFormat){
    case BINARY:
	case CACHED:
        return toData(value1).equals(toData(value2));
    case OBJECT:
        return toObject(value1).equals(toObject(value2));
    default:
        throw new IllegalStateException("Unrecognized InMemoryFormat: "+inMemoryFormat);
}
````