public List<AnticipatedTransition> parse(String requestBody, String userUuid, String projectKey) {
    List<GsonAnticipatedTransition> anticipatedTransitions;
    try {
      anticipatedTransitions = Arrays.asList(GSON.fromJson(requestBody, GsonAnticipatedTransition[].class));
    } catch (Exception e) {
      throw new IllegalStateException("Unable to parse anticipated transitions from request body.", e);
    }
    validateAnticipatedTransitions(anticipatedTransitions);
    return mapBodyToAnticipatedTransitions(anticipatedTransitions, userUuid, projectKey);
  }
@Test
  public void givenRequestBodyWithInvalidJson_whenParse_thenExceptionIsThrown() {
    // given
    String requestBody = "invalidJson";

    // when then
    Assertions.assertThatThrownBy(() -> underTest.parse(requestBody, USER_UUID, PROJECT_KEY))
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Unable to parse anticipated transitions from request body.");
  }