@Test
public void testCheckStateShouldThrowIllegalStateExceptionIfExpressionIsFalseAndReturnFormattedMessage() {

    // Given:
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage("error message template");
    // When:
    Preconditions.checkState(1 == 2, "error message %s", "template");
    // Then: expect exception
}