public final class BridgeDemo {
    static class Store<T> {
        private T value;

        void set(T next) {
            value = next;
        }

        T read() {
            return value;
        }
    }

    static final class TitleStore extends Store<String> {
        @Override
        void set(String next) {
            super.set(next.strip());
        }
    }

    private BridgeDemo() { }

    public static void main(String[] args) {
        Store<String> store = new TitleStore();
        store.set("  Java  ");
        System.out.println(store.read());
    }
}
