Making the example with MixedClass vs. NonMixed solution more real, so it can be unit tested
1 package org.apidesign.sidemeanings;
3 // BEGIN: sidemeanings.Mixed.Clean
4 public final class NonMixed {
7 private final Provider impl;
9 private NonMixed(Provider impl) {
12 public static NonMixed create(Provider impl) {
13 NonMixed api = new NonMixed(impl);
14 Callback callback = new Callback(api);
15 impl.initialize(callback);
19 public final int apiForClients() {
20 int subclass = impl.toBeImplementedBySubclass();
25 public interface Provider {
26 public void initialize(Callback c);
27 public int toBeImplementedBySubclass();
30 public static final class Callback {
33 Callback(NonMixed api) {
36 public final void toBeCalledBySubclass() {
41 // END: sidemeanings.Mixed.Clean