TypeBasedMultiplexer { public TypeBasedMultiplexer(final Object obj) { this(null, obj); } TypeBasedMultiplexer(final Object obj);  TypeBasedMultiplexer(final String keyOfObj, final Object obj);  TypeBasedMultiplexer(final String keyOfObj, final Object obj, final URI id); void addResolutionScopeChangeListener(
            final ResolutionScopeChangeListener resolutionScopeChangeListener); OnTypeConsumer<E> ifIs(final Class<E> predicateClass); OnTypeConsumer<JSONObject> ifObject(); void orElse(final Consumer<Object> orElseConsumer); void requireAny();  }
@Test public void typeBasedMultiplexerTest() { new TypeBasedMultiplexer(new JSONObject()) .ifObject().then(jsonObj -> { }) .ifIs(JSONArray.class).then(jsonArr -> { }) .orElse(obj -> { }); new TypeBasedMultiplexer(new JSONObject()) .ifObject().then(jsonObj -> { }) .ifIs(JSONArray.class).then(jsonArr -> { }) .requireAny(); }