public <S extends Service<T>> S getService( Class<S> type ) {
        for( Service s : services ) {
            if( type.isInstance(s) ) {
                return type.cast(s);
            }
        }
        return null;
    }
Retrieves the first service of the specified type.
jme3-networking/src/main/java/com/jme3/network/service/ServiceManager.java