ThriftDocServicePlugin implements DocServicePlugin { @VisibleForTesting static EnumInfo newEnumInfo(Class<? extends Enum<? extends TEnum>> enumType) { final List<EnumValueInfo> values = Arrays.stream(enumType.getEnumConstants()) .map(e -> new EnumValueInfo(e.name(), ((TEnum) e).getValue())) .collect(toImmutableList()); return new EnumInfo(enumType.getTypeName(), values); }  @Override String name(); @Override Set<Class<? extends Service<?, ?>>> supportedServiceTypes(); @Override ServiceSpecification generateSpecification(Set<ServiceConfig> serviceConfigs,
                                                      DocServiceFilter filter); @VisibleForTesting ServiceSpecification generate(List<Entry> entries, DocServiceFilter filter); @Override Map<String, String> loadDocStrings(Set<ServiceConfig> serviceConfigs); @Override Set<Class<?>> supportedExampleRequestTypes(); @Override String guessServiceName(Object exampleRequest); @Override String guessServiceMethodName(Object exampleRequest); @Override String serializeExampleRequest(String serviceName, String methodName,
                                          Object exampleRequest);  }
@Test void testNewEnumInfo() { final EnumInfo enumInfo = newEnumInfo(FooEnum.class); assertThat(enumInfo).isEqualTo(new EnumInfo(FooEnum.class.getName(), Arrays.asList(new EnumValueInfo("VAL1", 1), new EnumValueInfo("VAL2", 2), new EnumValueInfo("VAL3", 3)))); }