@Test public void checkLongerThan_with_long_enough_string_returns_the_string() { String message = "my message"; String string = "string"; String result = Preconditions.checkLongerThan(message, string, 2); assertEquals(string, result); }
public static String checkLongerThan(String message, String string, int minLength) { checkNotNull(message, string); if (string.length() < minLength) { throw new CreditCard4JException(message); } return string; }
Preconditions { public static String checkLongerThan(String message, String string, int minLength) { checkNotNull(message, string); if (string.length() < minLength) { throw new CreditCard4JException(message); } return string; } }
Preconditions { public static String checkLongerThan(String message, String string, int minLength) { checkNotNull(message, string); if (string.length() < minLength) { throw new CreditCard4JException(message); } return string; }  }
Preconditions { public static String checkLongerThan(String message, String string, int minLength) { checkNotNull(message, string); if (string.length() < minLength) { throw new CreditCard4JException(message); } return string; }  static String checkNotEmpty(String message, String string); static T checkNotNull(String message, T object); static String checkLongerThan(String message, String string, int minLength); static String checkIsDigitsOnly(String message, String string); }
Preconditions { public static String checkLongerThan(String message, String string, int minLength) { checkNotNull(message, string); if (string.length() < minLength) { throw new CreditCard4JException(message); } return string; }  static String checkNotEmpty(String message, String string); static T checkNotNull(String message, T object); static String checkLongerThan(String message, String string, int minLength); static String checkIsDigitsOnly(String message, String string);  }