### Question:
BaseSession implements DBSession, DBLeasedSession, DBTransaction { @SuppressWarnings("unchecked") @Nullable public synchronized <I> I getSpecificService(@NotNull final Class<I> serviceClass, @NotNull final String serviceName) throws ClassCastException { if (serviceName.equalsIgnoreCase(Names.INTERMEDIATE_SERVICE)) { return Objects.castTo(serviceClass, myInterSession); } else { return myInterSession.getSpecificService(serviceClass, serviceName); } } protected  BaseSession(@NotNull final IntegralIntermediateSession interSession); @Override void beginTransaction(); @Override boolean isInTransaction(); @Override void commit(); @Override void rollback(); @Override synchronized R inTransaction(final InTransaction<R> operation); @Override synchronized void inTransaction(final InTransactionNoResult operation); @NotNull @Override synchronized DBCommandRunner command(@NotNull final SqlCommand command); @NotNull @Override synchronized DBCommandRunner command(@NotNull final String commandText); @NotNull @Override synchronized BaseQueryRunner<S> query(@NotNull final SqlQuery<S> query); @NotNull @Override synchronized BaseQueryRunner<S> query(@NotNull final String queryText,
                                                    @NotNull final ResultLayout<S> layout); @NotNull @Override synchronized DBScriptRunner script(@NotNull final SqlScript script); @SuppressWarnings("unchecked") @Nullable synchronized I getSpecificService(@NotNull final Class<I> serviceClass,
                                                @NotNull final String serviceName); @Override long ping(); synchronized boolean isClosed(); synchronized void close();  }### Answer:
@Test public void get_intermediate_service() { myFacade.inSession(new InSessionNoResult() { @Override public void run(@NotNull final DBSession session) { final IntegralIntermediateSession intermediateSession = session.getSpecificService( IntegralIntermediateSession.class, ImplementationAccessibleService.Names.INTERMEDIATE_SERVICE); assertThat(intermediateSession).isInstanceOf(JdbcIntermediateSession.class); } }); }
@Test public void get_jdbc_connection() { myFacade.inSession(new InSessionNoResult() { @Override public void run(@NotNull final DBSession session) { java.sql.Connection connection = session.getSpecificService(java.sql.Connection.class, ImplementationAccessibleService.Names.JDBC_CONNECTION); assertThat(connection).isNotNull() .isInstanceOf(java.sql.Connection.class); } }); }