Keys { static String getBuiltInBindingsKey(String key) { int start = startOfType(key); if (substringStartsWith(key, start, PROVIDER_PREFIX)) { return extractKey(key, start, key.substring(0, start), PROVIDER_PREFIX); } else if (substringStartsWith(key, start, MEMBERS_INJECTOR_PREFIX)) { return extractKey(key, start, "members/", MEMBERS_INJECTOR_PREFIX); } else { return null; } } Keys(); static String get(Type type); static String getMembersKey(Class<?> key); static String getSetKey(Type type, Annotation[] annotations, Object subject); static String get(Type type, Annotation[] annotations, Object subject); static boolean isAnnotated(String key); static String getClassName(String key); static boolean isPlatformType(String name);  }
@Test public void testGetDelegateKey() throws NoSuchFieldException { assertThat(Keys.getBuiltInBindingsKey(fieldKey("providerOfType"))) .isEqualTo(fieldKey("providedType")); }
@Test public void testGetDelegateKeyWithAnnotation() throws NoSuchFieldException { assertThat(Keys.getBuiltInBindingsKey(fieldKey("providerOfTypeAnnotated"))) .isEqualTo(fieldKey("providedTypeAnnotated")); }
@Test public void testGetDelegateKeyWithMembersInjector() throws NoSuchFieldException { assertThat(Keys.getBuiltInBindingsKey(fieldKey("membersInjectorOfType"))) .isEqualTo("members/java.lang.String"); }