@Test public void testCheckState() { try { int x = 1; Preconditions.checkState(x == 5, "Argument was %s but expected 5", x); } catch (Exception e) { } try { int x = 1; Preconditions.checkState(x == 5); } catch (Exception e) { } try { int x = 1; Preconditions.checkState(x == 5, "Argument expected 5"); } catch (Exception e) { } }
public static void checkState(boolean expression) { if (!expression) { throw new IllegalStateException(); } }
Preconditions { public static void checkState(boolean expression) { if (!expression) { throw new IllegalStateException(); } } }
Preconditions { public static void checkState(boolean expression) { if (!expression) { throw new IllegalStateException(); } } private  Preconditions(); }
Preconditions { public static void checkState(boolean expression) { if (!expression) { throw new IllegalStateException(); } } private  Preconditions(); static void checkArgument(boolean expression); static void checkArgument(boolean expression, Object errorMessage); static void checkArgument(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static void checkState(boolean expression); static void checkState(boolean expression, Object errorMessage); static void checkState(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkNotNull(T reference); static T checkNotNull(T reference, Object errorMessage); static T checkNotNull(T reference, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkDeserializeNotNull(T reference); }
Preconditions { public static void checkState(boolean expression) { if (!expression) { throw new IllegalStateException(); } } private  Preconditions(); static void checkArgument(boolean expression); static void checkArgument(boolean expression, Object errorMessage); static void checkArgument(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static void checkState(boolean expression); static void checkState(boolean expression, Object errorMessage); static void checkState(boolean expression, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkNotNull(T reference); static T checkNotNull(T reference, Object errorMessage); static T checkNotNull(T reference, String errorMessageTemplate,
            Object... errorMessageArgs); static T checkDeserializeNotNull(T reference);  }