Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- testLinkedListCreatedEmpty();
- }
- private static void testLinkedListCreatedEmpty() {
- LinkedList list = new LinkedList();
- test(list.count() == 0, "List should be empty");
- }
- /*
- TEST helper methods
- */
- private static void test(boolean condition, String description) {
- try {
- check(condition, description);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- private static void check(boolean condition, String description) throws Exception {
- if (!condition) {
- throw new Exception(description);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement