### Question:
JacksonJsonLayout extends AbstractLayout<ItemSource> implements ItemSourceLayout, LifeCycle { @Override public byte[] toByteArray(LogEvent event) { throw new UnsupportedOperationException("Cannot return unwrapped byte array. Use ItemSource based API"); } protected  JacksonJsonLayout(Configuration config, ObjectWriter configuredWriter, ItemSourceFactory itemSourceFactory); @Override String getContentType(); @Override byte[] toByteArray(LogEvent event); @Override final ItemSource toSerializable(LogEvent event); @Override final ItemSource serialize(LogEvent event); @Override final ItemSource serialize(Message message); @PluginBuilderFactory static JacksonJsonLayout.Builder newBuilder(); @Override void start(); @Override void stop(); @Override boolean isStarted(); @Override boolean isStopped(); static final String PLUGIN_NAME; }### Answer:
@Test public void throwsOnByteArrayCreationAttempt() { JacksonJsonLayout layout = createDefaultTestBuilder().build(); expectedException.expect(UnsupportedOperationException.class); layout.toByteArray(new Log4jLogEvent()); }