title: Using Caffeine. Error with "get" in cache
body: <p>Here's the code:</p>
  
  <pre><code>package misc;
  import com.github.benmanes.caffeine.cache.Caffeine;
  import com.github.benmanes.caffeine.cache.Cache;
  import org.openjdk.jmh.annotations.*;
  import org.openjdk.jmh.runner.Runner;
  import org.openjdk.jmh.runner.RunnerException;
  import org.openjdk.jmh.runner.options.Options;
  import org.openjdk.jmh.runner.options.OptionsBuilder;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.concurrent.ThreadLocalRandom;
  import java.util.concurrent.TimeUnit;
  import java.util.function.Function;
  
  @State(Scope.Thread)
  public class caff {
  
  public Cache&lt;String, Integer&gt; cache = Caffeine.newBuilder().build();
  public ArrayList&lt;String&gt; k = new ArrayList&lt;&gt;();
  int p;
  
  @Setup(Level.Iteration)
  public void setup(){
      k.clear();
      //cache.clear();
      for(int m=0;m&lt;1000;m++){
          int j=ThreadLocalRandom.current().nextInt(0,10000);
          String jk=Integer.toString(j);
          k.add(jk);
          cache.put(jk,j);
      }
  }
  
  @Benchmark
  @BenchmarkMode(Mode.Throughput)
  @OperationsPerInvocation(10)
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  @Warmup(iterations = 3)
  @Measurement(iterations = 100)
  public void putKey() {
      int n= ThreadLocalRandom.current().nextInt(0,10000);
      String nk=Integer.toString(n);
      k.add(nk);
      cache.put(nk,n);
  }
  
  @Benchmark
  @BenchmarkMode(Mode.Throughput)
  @OperationsPerInvocation(10)
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  @Warmup(iterations = 3)
  @Measurement(iterations = 100)
  public void getKey() {
      String j;
      p = ThreadLocalRandom.current().nextInt(0, 10000);
      p = p % k.size();
      j = k.get(p);
      cache.get(j);
  }
  
  public static void main(String[] args) throws RunnerException {
      Options opt = new OptionsBuilder()
              .include(".*" + caff.class.getSimpleName() + ".*")
              .forks(1)
              //.addProfiler(GCProfiler.class)
              .jvmArgs("-Xmx1025M")
              .build();
      new Runner(opt).run();
  }
  }
  </code></pre>
  
  <p>The problem is that the cache.get() gives the error:</p>
  
  <pre><code>Error:(60, 14) java: method get in interface     com.github.benmanes.caffeine.cache.Cache&lt;K,V&gt; cannot be applied to given types;
    required: java.lang.String,java.util.function.Function&lt;? super java.lang.String,? extends java.lang.Integer&gt;
    found: java.lang.String
    reason: actual and formal argument lists differ in length
  </code></pre>
  
  <p>What exactly is expected in the get() method? I couldn't find any examples, and I don't understand why it would require another function.</p>