@@ -0,0 +1,1679 @@
+package xdean.jex.util.lang;%0D%0A%0D%0Aimport java.util.Arrays;%0D%0Aimport java.util.List;%0D%0Aimport java.util.Map;%0D%0Aimport java.util.Objects;%0D%0Aimport java.util.Optional;%0D%0Aimport java.util.function.Predicate;%0D%0Aimport java.util.stream.Stream;%0D%0A%0D%0Aimport lombok.experimental.UtilityClass;%0D%0A%0D%0A@UtilityClass%0D%0Apublic class AssertUtil %7B%0D%0A%0D%0A  public void assertTrue(boolean b) %7B%0D%0A    if (!b) %7B%0D%0A      throw new AssertionError();%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  public void assertEmpty(Optional%3C?%3E o) %7B%0D%0A    assertTrue(!o.isPresent());%0D%0A  %7D%0D%0A%0D%0A  public void assertPresent(Optional%3C?%3E o) %7B%0D%0A    assertTrue(o.isPresent());%0D%0A  %7D%0D%0A%0D%0A  public void assertNotNull(Object obj) %7B%0D%0A    Objects.requireNonNull(obj, %22ASSERT NOTNULL FAIL%22);%0D%0A  %7D%0D%0A%0D%0A  public void assertContainsAll(Map%3C?, ?%3E map, Object... keys) %7B%0D%0A    if (!isAllTrue(map::containsKey, keys)) %7B%0D%0A      throw new AssertionError(%22The map should has following keys: %22 + Arrays.toString(keys));%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  public void assertContainsAll(List%3C?%3E list, Object... elements) %7B%0D%0A    if (!isAllTrue(list::contains, elements)) %7B%0D%0A      throw new AssertionError(%22The list should has following elements: %22 + Arrays.toString(elements));%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  @SafeVarargs%0D%0A  private %3CT%3E boolean isAllTrue(Predicate%3C? super T%3E predicate, T... elements) %7B%0D%0A    return !Stream.of(elements).filter(predicate.negate()).findFirst().isPresent();%0D%0A  %7D%0D%0A%0D%0A  public void assertInstanceOf(Object object, Class%3C?%3E expectClass) %7B%0D%0A    boolean b = expectClass.isInstance(object);%0D%0A    if (b == false) %7B%0D%0A      throw new AssertionError(%0D%0A          String.format(%22The expect class is %25s, but actually %25s.%22, expectClass.getName(),%0D%0A              object.getClass().getName()));%0D%0A    %7D%0D%0A  %7D%0D%0A%7D%0D%0A

add AssertUtil