@Test
  public void testParseInvalid() {
    // null
    try {
      MemorySize.parseBytes(null);
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }

    // empty
    try {
      MemorySize.parseBytes("");
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }

    // blank
    try {
      MemorySize.parseBytes("     ");
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }

    // no number
    try {
      MemorySize.parseBytes("foobar or fubar or foo bazz");
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }

    // wrong unit
    try {
      MemorySize.parseBytes("16 gjah");
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }

    // multiple numbers
    try {
      MemorySize.parseBytes("16 16 17 18 bytes");
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }

    // negative number
    try {
      MemorySize.parseBytes("-100 bytes");
      fail("exception expected");
    } catch (IllegalArgumentException ignored) {
    }
  }
Tests for the {@link MemorySize} class.
amoro-common/src/test/java/org/apache/amoro/utils/MemorySizeTest.java