### Question:
ThriftUtils { public static String getThriftServiceName(Class<?> generatedChildClass, Optional<String> subServiceName){ Class<?> clazz = getThriftRootClass(generatedChildClass); if (subServiceName.isPresent()) { return clazz.getSimpleName() + "__" + subServiceName.get(); } else { return clazz.getSimpleName(); } }  static Class<?> getClassByName(Class<?> root, String name); static Class<?> getThriftRootClass(Class<?> generatedChildClass); static boolean parseBoolean(String val); static String getThriftServiceName(Class<?> generatedChildClass, Optional<String> subServiceName); static String getThriftServiceName(Class<?> generatedChildClass); static String getThriftFullServiceName(Class<?> generatedChildClass, Optional<String> subServiceName); static String getThriftFullServiceName(Class<?> generatedChildClass); static boolean isApplicationLevelException(Throwable ex); static String getHostName(); static CompletableFuture<T> firstSuccess(Stream<CompletableFuture<T>> futures); static boolean empty(String str); static long parseLong(byte[] bytes); static long parseLong(byte[] bytes, int offset); static final String QIWI_APP_HOST_NAME; }### Answer:
@Test(groups = "unit") public void getThriftServiceName() throws Exception { assertEquals(ThriftUtils.getThriftServiceName(SecondServer.Iface.class, Optional.empty()), "SecondServer"); assertEquals(ThriftUtils.getThriftServiceName(SecondServer.Iface.class, Optional.of("ms")), "SecondServer__ms"); }