### Question:
AbstractProcessorContext implements InternalProcessorContext { @Override public void register(final StateStore store, final boolean loggingEnabled, final StateRestoreCallback stateRestoreCallback) { if (initialized) { throw new IllegalStateException("Can only create state stores during initialization."); } Objects.requireNonNull(store, "store must not be null"); stateManager.register(store, loggingEnabled, stateRestoreCallback); } AbstractProcessorContext(final TaskId taskId,
                             final String applicationId,
                             final StreamsConfig config,
                             final StreamsMetrics metrics,
                             final StateManager stateManager,
                             final ThreadCache cache); @Override String applicationId(); @Override TaskId taskId(); @Override Serde<?> keySerde(); @Override Serde<?> valueSerde(); @Override File stateDir(); @Override StreamsMetrics metrics(); @Override void register(final StateStore store, final boolean loggingEnabled, final StateRestoreCallback stateRestoreCallback); @Override String topic(); @Override int partition(); @Override long offset(); @Override long timestamp(); @Override Map<String, Object> appConfigs(); @Override Map<String, Object> appConfigsWithPrefix(String prefix); @Override void setRecordContext(final RecordContext recordContext); @Override RecordContext recordContext(); @Override void setCurrentNode(final ProcessorNode currentNode); @Override ProcessorNode currentNode(); @Override ThreadCache getCache(); @Override void initialized();  }### Answer:
@Test public void shouldNotThrowIllegalStateExceptionOnRegisterWhenContextIsNotInitialized() throws Exception { context.register(stateStore, false, null); }
@Test(expected = NullPointerException.class) public void shouldThrowNullPointerOnRegisterIfStateStoreIsNull() { context.register(null, false, null); }