@Override
    public boolean equals(Object other) {
        if (other instanceof NamespaceBundle) {
            NamespaceBundle obj = (NamespaceBundle) other;
            return Objects.equals(this.nsname, obj.nsname)
                    && (Objects.equals(this.keyRange.lowerEndpoint(), obj.keyRange.lowerEndpoint())
                            && Objects.equals(this.keyRange.lowerBoundType(), obj.keyRange.lowerBoundType())
                            && Objects.equals(this.keyRange.upperEndpoint(), obj.keyRange.upperEndpoint())
                            && Objects.equals(this.keyRange.upperBoundType(), obj.keyRange.upperBoundType()));
        }
        return false;
    }
@Test
    public void testEquals() throws Exception {
        NamespaceBundle bundle = factory.getBundle(NamespaceName.get("pulsar/use/ns1"),
                Range.range(0l, BoundType.CLOSED, 0x40000000L, BoundType.OPEN));
        NamespaceBundle bundle2 = factory.getBundle(NamespaceName.get("pulsar/use/ns1"),
                Range.range(0x20000000l, BoundType.CLOSED, 0x40000000L, BoundType.OPEN));
        assertNotEquals(bundle2, bundle);

        NamespaceBundle bundle0 = factory.getBundle(NamespaceName.get("pulsar/use/ns1"),
                Range.range(0l, BoundType.CLOSED, 0x40000000L, BoundType.OPEN));
        assertEquals(bundle, bundle0);

        NamespaceBundle otherBundle = factory.getBundle(NamespaceName.get("pulsar/use/ns2"),
                Range.range(0l, BoundType.CLOSED, 0x40000000L, BoundType.OPEN));
        assertNotEquals(bundle, otherBundle);
    }