VariantKeyGenerator implements KeyGenerator { @Override public Object generate(Object o, Method method, Object... params) { return generateKey(params); }  @Override Object generate(Object o, Method method, Object... params); static Object generateKey(Object... params);  }
@Test public void returnsEmptyKeyForEmptyQuery() throws Exception { assertThat(instance.generate(new Object(), Object.class.getMethod("toString")), equalTo(SimpleKey.EMPTY)); }
@Test public void returnsKeyForVariant() throws Exception { Variant variant = VariantAnnotation.builder() .chromosome(1) .position(2345) .ref("A") .alt("T") .build(); AlleleProto.AlleleKey expected = AlleleProto.AlleleKey.newBuilder() .setChr(1) .setPosition(2345) .setRef("A") .setAlt("T") .build(); assertThat(instance.generate(new Object(), Object.class.getMethod("toString"), variant), equalTo(expected)); }
@Test public void returnsSimpleKeyForManyThings() throws Exception { Object object1 = new Object(); Object object2 = new Object(); assertThat(instance.generate(new Object(), Object.class.getMethod("toString"), object1, object2), equalTo(new SimpleKey(object1, object2))); }