ProjectionJavaScriptBuilder { public final String build() { if (count == 0) { throw new IllegalStateException("No types were added. Use 'type(String)' to add at least one event."); } sb.append("})"); return sb.toString(); } ProjectionJavaScriptBuilder(@NotNull final TenantStreamId tenantStreamId);  ProjectionJavaScriptBuilder(@NotNull final StreamId projectionId);  ProjectionJavaScriptBuilder(@NotNull final String projection);  ProjectionJavaScriptBuilder(@NotNull final StreamId projectionId, @NotNull final StreamId categoryId);  ProjectionJavaScriptBuilder(@NotNull final String projection, @NotNull final String category); final ProjectionJavaScriptBuilder type(final String eventType); final ProjectionJavaScriptBuilder type(final TypeName eventType); final ProjectionJavaScriptBuilder types(final List<TypeName> eventTypes); final String build();  }
@Test public void testNoEventType() { final ProjectionJavaScriptBuilder testee = new ProjectionJavaScriptBuilder("AccountsView", "account"); try { testee.build(); fail(); } catch (final IllegalStateException ex) { assertThat(ex.getMessage()) .isEqualTo("No types were added. Use 'type(String)' to add at least one event."); } }