### Question:
GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params); } GetAllPossibleTokensKeyGenerator(final KeyGenerator simpleKeyGenerator); @Override Object generate(final Object target, final Method method, final Object... params);  }### Answer:
@Test void generate_GitHubKey() { final String owner = "sgfgs"; final String repo = "szgff"; final String platform = Platform.GITHUB.name(); final String result = (String) keyGenerator.generate(randomTarget, randomMethod, platform, owner + "|FR|" + repo + "|FR|435"); assertThat(result).isEqualTo(platform + "-" + owner + "-" + repo); }
@Test void generate_OtherPlatformKey() { final String platform = Platform.STACK_OVERFLOW.name(); final String platformId = "sgfgasfdgshd5"; final String expected = "someKey"; when(fallbackKeyGenerator.generate(randomTarget, randomMethod, platform, platformId)).thenReturn(expected); final String result = (String) keyGenerator.generate(randomTarget, randomMethod, platform, platformId); assertThat(result).isEqualTo(expected); }