### Question:
JPAConfig { public JPAContext getContext() { return getContext(false); } JPAConfig(String name, EntityManagerProvider provider); void close(); JPAContext getContext(); JPAContext getContext(boolean readOnly); String getName(); EntityManagerProvider getEntityManagerProvider();  }### Answer:
@Test public void shouldGetContext() { JPAContext context = config.getContext(); assertNotNull(context); assertFalse(context.isReadOnly()); }
@Test public void shouldGetReadOnlyContext() { JPAContext context = config.getContext(true); assertNotNull(context); assertTrue(context.isReadOnly()); }
@Test public void shouldGetReadWriteContext() { JPAContext context = config.getContext(false); assertNotNull(context); assertFalse(context.isReadOnly()); }
@Test public void shouldGetSameContextSecondTime() { JPAContext context = config.getContext(true); assertEquals(context, config.getContext()); }