target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test(expected = UnsupportedOperationException.class) public void add() throws Exception { RangeSet rs = new RangeSet(4); rs.add(1); } | @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... |
@Test(expected = UnsupportedOperationException.class) public void add1() throws Exception { RangeSet rs = new RangeSet(4); rs.add(Integer.valueOf(1)); } | @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... |
@Test(expected = UnsupportedOperationException.class) public void set() throws Exception { RangeSet rs = new RangeSet(4); rs.set(1); } | public void set(int i) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { public void set(int i) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { public void set(int i) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { public void set(int i) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt iterator(); @Overrid... | RangeSet implements IntSet { public void set(int i) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt iterator(); @Overrid... |
@Test(expected = UnsupportedOperationException.class) public void remove() throws Exception { RangeSet rs = new RangeSet(4); rs.remove(1); } | @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt i... | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt i... |
@Test public void testSize() { assertEquals(0, es.size()); } | @Override public int size() { return 0; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public int size() { return 0; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public int size() { return 0; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public int size() { return 0; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterator.OfInt i... | EmptyIntSet extends AbstractImmutableIntSet { @Override public int size() { return 0; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterator.OfInt i... |
@Test(expected = UnsupportedOperationException.class) public void remove1() throws Exception { RangeSet rs = new RangeSet(4); rs.remove(Integer.valueOf(1)); } | @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt i... | RangeSet implements IntSet { @Override public boolean remove(Object o) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt i... |
@Test public void containsAll() throws Exception { RangeSet rs = new RangeSet(4); RangeSet rs2 = new RangeSet(4); assertTrue(rs.containsAll(rs2)); RangeSet rs3 = new RangeSet(3); assertTrue(rs.containsAll(rs3)); assertFalse(rs3.containsAll(rs)); } | @Override public boolean containsAll(Collection<?> c) { if (c instanceof IntSet) { return containsAll((IntSet) c); } for (Object o : c) { if (!contains(o)) return false; } return true; } | RangeSet implements IntSet { @Override public boolean containsAll(Collection<?> c) { if (c instanceof IntSet) { return containsAll((IntSet) c); } for (Object o : c) { if (!contains(o)) return false; } return true; } } | RangeSet implements IntSet { @Override public boolean containsAll(Collection<?> c) { if (c instanceof IntSet) { return containsAll((IntSet) c); } for (Object o : c) { if (!contains(o)) return false; } return true; } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean containsAll(Collection<?> c) { if (c instanceof IntSet) { return containsAll((IntSet) c); } for (Object o : c) { if (!contains(o)) return false; } return true; } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object... | RangeSet implements IntSet { @Override public boolean containsAll(Collection<?> c) { if (c instanceof IntSet) { return containsAll((IntSet) c); } for (Object o : c) { if (!contains(o)) return false; } return true; } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object... |
@Test(expected = UnsupportedOperationException.class) public void addAll() throws Exception { RangeSet rs = new RangeSet(4); RangeSet rs2 = new RangeSet(5); rs.addAll(rs2); } | @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt... | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt... |
@Test(expected = UnsupportedOperationException.class) public void addAll1() throws Exception { RangeSet rs = new RangeSet(4); SmallIntSet sis = new SmallIntSet(); rs.addAll(sis); } | @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt... | RangeSet implements IntSet { @Override public boolean addAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt... |
@Test(expected = UnsupportedOperationException.class) public void removeAll() throws Exception { RangeSet rs = new RangeSet(4); RangeSet rs2 = new RangeSet(6); rs.removeAll(rs2); } | @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.Of... | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.Of... |
@Test(expected = UnsupportedOperationException.class) public void removeAll1() throws Exception { RangeSet rs = new RangeSet(5); SmallIntSet sis = new SmallIntSet(); rs.removeAll(sis); } | @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.Of... | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.Of... |
@Test(expected = UnsupportedOperationException.class) public void removeAll2() throws Exception { RangeSet rs = new RangeSet(4); Set<Integer> hashSet = new HashSet<>(); rs.removeAll(hashSet); } | @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.Of... | RangeSet implements IntSet { @Override public boolean removeAll(IntSet set) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.Of... |
@Test(expected = UnsupportedOperationException.class) public void retainAll() throws Exception { RangeSet rs = new RangeSet(4); RangeSet rs2 = new RangeSet(5); rs.retainAll(rs2); } | @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterat... | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterat... |
@Test(expected = UnsupportedOperationException.class) public void retainAll1() throws Exception { IntSet rs = new RangeSet(5); SmallIntSet sis = new SmallIntSet(); rs.retainAll(sis); } | @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterat... | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterat... |
@Test(expected = UnsupportedOperationException.class) public void retainAll2() throws Exception { RangeSet rs = new RangeSet(4); Set<Integer> hashSet = new HashSet<>(); rs.retainAll(hashSet); } | @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterat... | RangeSet implements IntSet { @Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterat... |
@Test public void testIsEmpty() { assertTrue(es.isEmpty()); } | @Override public boolean isEmpty() { return true; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return true; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return true; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return true; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterat... | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return true; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterat... |
@Test(expected = UnsupportedOperationException.class) public void clear() throws Exception { RangeSet rs = new RangeSet(5); rs.clear(); } | @Override public void clear() { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public void clear() { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public void clear() { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public void clear() { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt iterator(); @... | RangeSet implements IntSet { @Override public void clear() { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt iterator(); @... |
@Test public void intStream() throws Exception { IntSet rs = new RangeSet(5); assertEquals(10, rs.intStream().sum()); } | @Override public IntStream intStream() { return IntStream.range(0, size); } | RangeSet implements IntSet { @Override public IntStream intStream() { return IntStream.range(0, size); } } | RangeSet implements IntSet { @Override public IntStream intStream() { return IntStream.range(0, size); } RangeSet(int size); } | RangeSet implements IntSet { @Override public IntStream intStream() { return IntStream.range(0, size); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt iterator(); @Override int[] toIntArra... | RangeSet implements IntSet { @Override public IntStream intStream() { return IntStream.range(0, size); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfInt iterator(); @Override int[] toIntArra... |
@Test public void equals() throws Exception { RangeSet rs = new RangeSet(4); RangeSet rs2 = new RangeSet(5); assertNotEquals(rs, rs2); assertNotEquals(rs2, rs); RangeSet rs3 = new RangeSet(4); assertEquals(rs3, rs); assertEquals(rs, rs3); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof Set)) return false; if (o instanceof RangeSet) { RangeSet integers = (RangeSet) o; return size == integers.size; } else { Set set = (Set) o; return size == set.size() && containsAll(set); } } | RangeSet implements IntSet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof Set)) return false; if (o instanceof RangeSet) { RangeSet integers = (RangeSet) o; return size == integers.size; } else { Set set = (Set) o; return size == set.size() && containsAll(set);... | RangeSet implements IntSet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof Set)) return false; if (o instanceof RangeSet) { RangeSet integers = (RangeSet) o; return size == integers.size; } else { Set set = (Set) o; return size == set.size() && containsAll(set);... | RangeSet implements IntSet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof Set)) return false; if (o instanceof RangeSet) { RangeSet integers = (RangeSet) o; return size == integers.size; } else { Set set = (Set) o; return size == set.size() && containsAll(set);... | RangeSet implements IntSet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof Set)) return false; if (o instanceof RangeSet) { RangeSet integers = (RangeSet) o; return size == integers.size; } else { Set set = (Set) o; return size == set.size() && containsAll(set);... |
@Test public void equals1() throws Exception { IntSet intSet = new RangeSet(4); SmallIntSet sis = new SmallIntSet(); sis.add(0); sis.add(1); sis.add(2); assertNotEquals(sis, intSet); assertNotEquals(intSet, sis); sis.add(3); assertEquals(sis, intSet); assertEquals(intSet, sis); } | @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... |
@Test public void equals2() throws Exception { IntSet rs = new RangeSet(4); Set<Integer> hashSet = new HashSet<>(); hashSet.add(0); hashSet.add(1); hashSet.add(2); assertNotEquals(rs, hashSet); assertNotEquals(hashSet, rs); hashSet.add(3); assertEquals(rs, hashSet); assertEquals(hashSet, rs); } | @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... | RangeSet implements IntSet { @Override public boolean add(Integer integer) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIterator.OfI... |
@Test(expected = UnsupportedOperationException.class) public void removeIfPrimitive() { RangeSet rs = new RangeSet(4); rs.removeIf((int i) -> i == 3); } | @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIte... | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIte... |
@Test(expected = UnsupportedOperationException.class) public void removeIfObject() { RangeSet rs = new RangeSet(4); rs.removeIf((Integer i) -> i == 3); } | @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } } | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); } | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIte... | RangeSet implements IntSet { @Override public boolean removeIf(IntPredicate filter) { throw new UnsupportedOperationException("RangeSet is immutable"); } RangeSet(int size); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override boolean contains(int i); @Override PrimitiveIte... |
@Test public void testSize() { IntSet rs = new SingletonIntSet(3); assertEquals(1, rs.size()); } | @Override public int size() { return 1; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public int size() { return 1; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public int size() { return 1; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public int size() { return 1; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterator.OfInt... | SingletonIntSet extends AbstractImmutableIntSet { @Override public int size() { return 1; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIterator.OfInt... |
@Test public void testIsEmpty() { IntSet rs = new SingletonIntSet(3); assertFalse(rs.isEmpty()); } | @Override public boolean isEmpty() { return false; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return false; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return false; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return false; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIte... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean isEmpty() { return false; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override PrimitiveIte... |
@Test public void testContains() throws Exception { IntSet sis = new SingletonIntSet(3); assertFalse(sis.contains(5)); assertTrue(sis.contains(3)); } | @Override public boolean contains(int i) { return value == i; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override P... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override P... |
@Test public void testContains() throws Exception { assertFalse(es.contains(5)); assertFalse(es.contains(3)); } | @Override public boolean contains(int i) { return false; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primitiv... | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primitiv... |
@Test public void testContains1() throws Exception { IntSet sis = new SingletonIntSet(3); assertFalse(sis.contains(Integer.valueOf(5))); assertTrue(sis.contains(Integer.valueOf(3))); } | @Override public boolean contains(int i) { return value == i; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override P... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return value == i; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override P... |
@Test public void testIterator() throws Exception { IntSet sis = new SingletonIntSet(3); PrimitiveIterator.OfInt iterator = sis.iterator(); assertEquals(3, iterator.nextInt()); assertFalse(iterator.hasNext()); } | @Override public PrimitiveIterator.OfInt iterator() { return new SingleIntIterator(); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return new SingleIntIterator(); } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return new SingleIntIterator(); } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return new SingleIntIterator(); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contain... | SingletonIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return new SingleIntIterator(); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contain... |
@Test public void testToArray() throws Exception { IntSet sis = new SingletonIntSet(3); Object[] array = sis.toArray(); assertEquals(1, array.length); assertEquals(3, array[0]); } | @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override... | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override... |
@Test public void testToArray1() throws Exception { IntSet sis = new SingletonIntSet(3); Object[] array = sis.toArray(new Integer[1]); assertEquals(1, array.length); assertEquals(3, array[0]); } | @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override... | SingletonIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { Object[] array = new Object[1]; array[0] = value; return array; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override... |
@Test public void testToIntArray() throws Exception { IntSet sis = new SingletonIntSet(3); int[] array = sis.toIntArray(); assertArrayEquals(new int[]{3}, array); } | @Override public int[] toIntArray() { int[] array = new int[1]; array[0] = value; return array; } | SingletonIntSet extends AbstractImmutableIntSet { @Override public int[] toIntArray() { int[] array = new int[1]; array[0] = value; return array; } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public int[] toIntArray() { int[] array = new int[1]; array[0] = value; return array; } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public int[] toIntArray() { int[] array = new int[1]; array[0] = value; return array; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boole... | SingletonIntSet extends AbstractImmutableIntSet { @Override public int[] toIntArray() { int[] array = new int[1]; array[0] = value; return array; } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boole... |
@Test public void testContainsAll() throws Exception { IntSet sis = new SingletonIntSet(3); IntSet sis2 = new SingletonIntSet(3); assertTrue(sis.containsAll(sis2)); assertTrue(sis2.containsAll(sis)); IntSet sis3 = new RangeSet(4); assertTrue(sis3.containsAll(sis)); assertFalse(sis.containsAll(sis3)); } | @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override bo... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override bo... |
@Test public void testContainsAll1() throws Exception { IntSet sis = new SingletonIntSet(3); Set<Integer> hashSet = new HashSet<>(Arrays.asList(3)); assertTrue(sis.containsAll(hashSet)); assertTrue(hashSet.containsAll(sis)); hashSet.add(0); assertTrue(hashSet.containsAll(sis)); assertFalse(sis.containsAll(hashSet)); } | @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override bo... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { int size = set.size(); return size == 0 || size == 1 && set.contains(value); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override bo... |
@Test public void testIntStream() throws Exception { IntSet sis = new SingletonIntSet(3); assertEquals(1, sis.intStream().count()); } | @Override public IntStream intStream() { return IntStream.of(value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public IntStream intStream() { return IntStream.of(value); } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public IntStream intStream() { return IntStream.of(value); } SingletonIntSet(int value); } | SingletonIntSet extends AbstractImmutableIntSet { @Override public IntStream intStream() { return IntStream.of(value); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Ove... | SingletonIntSet extends AbstractImmutableIntSet { @Override public IntStream intStream() { return IntStream.of(value); } SingletonIntSet(int value); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Ove... |
@Test public void testEquals() throws Exception { IntSet sis = new SingletonIntSet(3); IntSet sis2 = new SingletonIntSet(4); assertNotEquals(sis, sis2); assertNotEquals(sis2, sis); IntSet sis3 = SmallIntSet.of(3); assertEquals(sis3, sis); assertEquals(sis, sis3); } | @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return set.size() == 1 && set.contains(value); } } | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return... | SingletonIntSet extends AbstractImmutableIntSet { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Set)) return false; if (o instanceof IntSet) { IntSet intSet = (IntSet) o; return intSet.size() == 1 && intSet.contains(value); } else { Set set = (Set) o; return... |
@Test @Category(Java11.class) public void testCPUCount() { assertTrue(ProcessorInfo.availableProcessors() <= Runtime.getRuntime().availableProcessors()); } | public static int availableProcessors() { if (System.getSecurityManager() != null) { return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.valueOf(org.infinispan.commons.jdkspecific.ProcessorInfo.availableProcessors()).intValue()); } return org.infinispan.commons.jdkspecific.ProcessorInfo.avail... | ProcessorInfo { public static int availableProcessors() { if (System.getSecurityManager() != null) { return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.valueOf(org.infinispan.commons.jdkspecific.ProcessorInfo.availableProcessors()).intValue()); } return org.infinispan.commons.jdkspecific.Pro... | ProcessorInfo { public static int availableProcessors() { if (System.getSecurityManager() != null) { return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.valueOf(org.infinispan.commons.jdkspecific.ProcessorInfo.availableProcessors()).intValue()); } return org.infinispan.commons.jdkspecific.Pro... | ProcessorInfo { public static int availableProcessors() { if (System.getSecurityManager() != null) { return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.valueOf(org.infinispan.commons.jdkspecific.ProcessorInfo.availableProcessors()).intValue()); } return org.infinispan.commons.jdkspecific.Pro... | ProcessorInfo { public static int availableProcessors() { if (System.getSecurityManager() != null) { return AccessController.doPrivileged((PrivilegedAction<Integer>) () -> Integer.valueOf(org.infinispan.commons.jdkspecific.ProcessorInfo.availableProcessors()).intValue()); } return org.infinispan.commons.jdkspecific.Pro... |
@Test public void testContains1() throws Exception { assertFalse(es.contains(Integer.valueOf(5))); assertFalse(es.contains(Integer.valueOf(3))); } | @Override public boolean contains(int i) { return false; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primitiv... | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean contains(int i) { return false; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primitiv... |
@Test public void testFeatures() { Features features = new Features(); assertFalse(features.isAvailable("A")); assertTrue(features.isAvailable("B")); } | public Features(ClassLoader classLoader) { features = new Properties(); try { Collection<URL> featureFiles = FileLookupFactory.newInstance().lookupFileLocations(FEATURES_FILE, classLoader); for (URL url : featureFiles) { try (InputStream is = url.openStream()) { features.load(is); } } if (log.isDebugEnabled()) { featur... | Features { public Features(ClassLoader classLoader) { features = new Properties(); try { Collection<URL> featureFiles = FileLookupFactory.newInstance().lookupFileLocations(FEATURES_FILE, classLoader); for (URL url : featureFiles) { try (InputStream is = url.openStream()) { features.load(is); } } if (log.isDebugEnabled(... | Features { public Features(ClassLoader classLoader) { features = new Properties(); try { Collection<URL> featureFiles = FileLookupFactory.newInstance().lookupFileLocations(FEATURES_FILE, classLoader); for (URL url : featureFiles) { try (InputStream is = url.openStream()) { features.load(is); } } if (log.isDebugEnabled(... | Features { public Features(ClassLoader classLoader) { features = new Properties(); try { Collection<URL> featureFiles = FileLookupFactory.newInstance().lookupFileLocations(FEATURES_FILE, classLoader); for (URL url : featureFiles) { try (InputStream is = url.openStream()) { features.load(is); } } if (log.isDebugEnabled(... | Features { public Features(ClassLoader classLoader) { features = new Properties(); try { Collection<URL> featureFiles = FileLookupFactory.newInstance().lookupFileLocations(FEATURES_FILE, classLoader); for (URL url : featureFiles) { try (InputStream is = url.openStream()) { features.load(is); } } if (log.isDebugEnabled(... |
@Test public void featureSysOverride() { Features features = new Features(); assertFalse(features.isAvailable("A")); System.setProperty("org.infinispan.feature.A", "true"); System.setProperty("org.infinispan.feature.B", "false"); boolean a = features.isAvailable("A"); boolean b = features.isAvailable("B"); System.clear... | public boolean isAvailable(String featureName) { String name = FEATURE_PREFIX + featureName; String sysprop = SecurityActions.getProperty(name); if (sysprop != null) { return Boolean.parseBoolean(sysprop); } else { return Boolean.parseBoolean(features.getProperty(name, "true")); } } | Features { public boolean isAvailable(String featureName) { String name = FEATURE_PREFIX + featureName; String sysprop = SecurityActions.getProperty(name); if (sysprop != null) { return Boolean.parseBoolean(sysprop); } else { return Boolean.parseBoolean(features.getProperty(name, "true")); } } } | Features { public boolean isAvailable(String featureName) { String name = FEATURE_PREFIX + featureName; String sysprop = SecurityActions.getProperty(name); if (sysprop != null) { return Boolean.parseBoolean(sysprop); } else { return Boolean.parseBoolean(features.getProperty(name, "true")); } } Features(ClassLoader clas... | Features { public boolean isAvailable(String featureName) { String name = FEATURE_PREFIX + featureName; String sysprop = SecurityActions.getProperty(name); if (sysprop != null) { return Boolean.parseBoolean(sysprop); } else { return Boolean.parseBoolean(features.getProperty(name, "true")); } } Features(ClassLoader clas... | Features { public boolean isAvailable(String featureName) { String name = FEATURE_PREFIX + featureName; String sysprop = SecurityActions.getProperty(name); if (sysprop != null) { return Boolean.parseBoolean(sysprop); } else { return Boolean.parseBoolean(features.getProperty(name, "true")); } } Features(ClassLoader clas... |
@Test public void testPrimitiveArrays() throws Exception { JavaSerializationMarshaller marshaller = new JavaSerializationMarshaller(); byte[] bytes = marshaller.objectToByteBuffer(new byte[0]); assertArrayEquals(new byte[0], (byte[]) marshaller.objectFromByteBuffer(bytes)); bytes = marshaller.objectToByteBuffer(new sho... | @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } JavaSeriali... | JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } JavaSeriali... | JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } JavaSeriali... |
@Test public void testBoxedPrimitivesAndArray() throws Exception { JavaSerializationMarshaller marshaller = new JavaSerializationMarshaller(); isMarshallable(marshaller, Byte.MAX_VALUE); isMarshallable(marshaller, Short.MAX_VALUE); isMarshallable(marshaller, Integer.MAX_VALUE); isMarshallable(marshaller, Long.MAX_VALUE... | @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByt... | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByt... |
@Test public void testMath() throws Exception { JavaSerializationMarshaller marshaller = new JavaSerializationMarshaller(); isMarshallable(marshaller, BigDecimal.TEN); isMarshallable(marshaller, BigInteger.TEN); } | @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByt... | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByt... |
@Test public void testDate() throws Exception { JavaSerializationMarshaller marshaller = new JavaSerializationMarshaller(); isMarshallable(marshaller, Instant.now()); } | @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); } | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByt... | JavaSerializationMarshaller extends AbstractMarshaller { @Override public boolean isMarshallable(Object o) { return o instanceof Serializable; } JavaSerializationMarshaller(); JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByt... |
@Test public void testResolver() { assertNull(MediaTypeResolver.getMediaType(null)); assertNull(MediaTypeResolver.getMediaType("noextension")); assertNull(MediaTypeResolver.getMediaType("124.")); assertEquals("application/javascript", MediaTypeResolver.getMediaType("file.js")); assertEquals("image/jpeg", MediaTypeResol... | public static String getMediaType(String fileName) { if (fileName == null) return null; int idx = fileName.lastIndexOf("."); if (idx == -1 || idx == fileName.length()) return null; return FILE_MAP.get(fileName.toLowerCase().substring(idx + 1)); } | MediaTypeResolver { public static String getMediaType(String fileName) { if (fileName == null) return null; int idx = fileName.lastIndexOf("."); if (idx == -1 || idx == fileName.length()) return null; return FILE_MAP.get(fileName.toLowerCase().substring(idx + 1)); } } | MediaTypeResolver { public static String getMediaType(String fileName) { if (fileName == null) return null; int idx = fileName.lastIndexOf("."); if (idx == -1 || idx == fileName.length()) return null; return FILE_MAP.get(fileName.toLowerCase().substring(idx + 1)); } private MediaTypeResolver(); } | MediaTypeResolver { public static String getMediaType(String fileName) { if (fileName == null) return null; int idx = fileName.lastIndexOf("."); if (idx == -1 || idx == fileName.length()) return null; return FILE_MAP.get(fileName.toLowerCase().substring(idx + 1)); } private MediaTypeResolver(); static String getMediaT... | MediaTypeResolver { public static String getMediaType(String fileName) { if (fileName == null) return null; int idx = fileName.lastIndexOf("."); if (idx == -1 || idx == fileName.length()) return null; return FILE_MAP.get(fileName.toLowerCase().substring(idx + 1)); } private MediaTypeResolver(); static String getMediaT... |
@Test public void testParsingTypeSubType() { MediaType appJson = MediaType.fromString("application/json"); assertMediaTypeNoParams(appJson, "application", "json"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingMultipleSubType() { MediaType.fromString("application/json/on"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingNoSubType() { MediaType.fromString("something"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testIterator() throws Exception { PrimitiveIterator.OfInt iterator = es.iterator(); assertFalse(iterator.hasNext()); } | @Override public PrimitiveIterator.OfInt iterator() { return EmptyIntIterator.INSTANCE; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return EmptyIntIterator.INSTANCE; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return EmptyIntIterator.INSTANCE; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return EmptyIntIterator.INSTANCE; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contain... | EmptyIntSet extends AbstractImmutableIntSet { @Override public PrimitiveIterator.OfInt iterator() { return EmptyIntIterator.INSTANCE; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contain... |
@Test(expected = EncodingException.class) public void testParsingNoSubType2() { MediaType.fromString("application; charset=utf-8"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingNull() { MediaType.fromString(null); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingWhitespaceInType() { MediaType.fromString("application /json"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingWhitespaceInSubtype() { MediaType.fromString("application/ json"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingWhitespaceInTypeSubtype() { MediaType.fromString("application / json"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testParsingWhitespaceInParamName() { MediaType.fromString("application/json; charset =utf-8"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testQuotedParam() { MediaType mediaType = MediaType.fromString("application/json; charset=\"UTF-8\""); assertMediaTypeWithParam(mediaType, "application", "json", "charset", "\"UTF-8\""); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testQuotedParamsWithWhitespace() { MediaType mediaType = MediaType.fromString("application/json; charset=\" UTF-8 \""); assertMediaTypeWithParam(mediaType, "application", "json", "charset", "\" UTF-8 \""); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testQuotedParamsEscaping() { MediaType mediaType = MediaType.fromString("application/json; charset=\"\\\"UTF-8\\\"\""); assertMediaTypeWithParam(mediaType, "application", "json", "charset", "\"\\\"UTF-8\\\"\""); MediaType mediaType2 = MediaType.fromString("application/json; charset=\"\\a\\\"\\\\\""); ... | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testUnquotedParamWithSingleQuote() { MediaType mediaType = MediaType.fromString("application/json; charset='UTF-8'"); assertMediaTypeWithParam(mediaType, "application", "json", "charset", "'UTF-8'"); Exceptions.expectException(EncodingException.class, () -> MediaType.fromString("application/json; char... | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testToArray() throws Exception { Object[] array = es.toArray(); assertEquals(0, array.length); } | @Override public Object[] toArray() { return new Object[0]; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primi... | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primi... |
@Test public void testUnQuotedParam() { MediaType mediaType = MediaType.fromString("application/json; charset=UTF-8"); assertMediaTypeWithParam(mediaType, "application", "json", "charset", "UTF-8"); Exceptions.expectException(EncodingException.class, () -> MediaType.fromString("application/json; charset=utf 8")); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testToString() { assertEquals("application/xml", new MediaType("application", "xml", createMap(new MapEntry("q", "0.9"))).toString()); assertEquals("text/csv", new MediaType("text", "csv").toString()); assertEquals("foo/bar; a=2", new MediaType("foo", "bar", createMap(new MapEntry("a", "2"))).toString... | @Override public String toString() { return toStringExcludingParam(WEIGHT_PARAM_NAME); } | MediaType { @Override public String toString() { return toStringExcludingParam(WEIGHT_PARAM_NAME); } } | MediaType { @Override public String toString() { return toStringExcludingParam(WEIGHT_PARAM_NAME); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(String typeSubtype); MediaType(String typeSubType, Map<String, String> params); private MediaType... | MediaType { @Override public String toString() { return toStringExcludingParam(WEIGHT_PARAM_NAME); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(String typeSubtype); MediaType(String typeSubType, Map<String, String> params); private MediaType... | MediaType { @Override public String toString() { return toStringExcludingParam(WEIGHT_PARAM_NAME); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(String typeSubtype); MediaType(String typeSubType, Map<String, String> params); private MediaType... |
@Test(expected = EncodingException.class) public void testUnQuotedParamWithSpaces() { MediaType mediaType = MediaType.fromString("application/json ; charset= UTF-8"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testWrongQuoting() { MediaType.fromString("application/json;charset= \"UTF-8"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testMultipleParameters() { MediaType mediaType = MediaType.fromString("application/json; charset=UTF-8; param1=value1 ;param2=value2"); assertMediaTypeWithParams(mediaType, "application", "json", new String[]{"charset", "param1", "param2"}, new String[]{"UTF-8", "value1", "value2"}); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test(expected = EncodingException.class) public void testMultipleParametersWrongSeparator() { MediaType.fromString("application/json; charset=UTF-8; param1=value1, param2=value2"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testParseWeight() { MediaType mediaType = MediaType.fromString("application/json; q=0.8"); assertEquals(0.8, mediaType.getWeight(), 0.0); } | private static double parseWeight(String weightValue) { try { return Double.parseDouble(weightValue); } catch (NumberFormatException nf) { throw CONTAINER.invalidWeight(weightValue); } } | MediaType { private static double parseWeight(String weightValue) { try { return Double.parseDouble(weightValue); } catch (NumberFormatException nf) { throw CONTAINER.invalidWeight(weightValue); } } } | MediaType { private static double parseWeight(String weightValue) { try { return Double.parseDouble(weightValue); } catch (NumberFormatException nf) { throw CONTAINER.invalidWeight(weightValue); } } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { private static double parseWeight(String weightValue) { try { return Double.parseDouble(weightValue); } catch (NumberFormatException nf) { throw CONTAINER.invalidWeight(weightValue); } } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { private static double parseWeight(String weightValue) { try { return Double.parseDouble(weightValue); } catch (NumberFormatException nf) { throw CONTAINER.invalidWeight(weightValue); } } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... |
@Test(expected = EncodingException.class) public void testParseInvalidWeight() { MediaType.fromString("application/json ; q=high"); } | @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } } | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... | MediaType { @ProtoFactory public static MediaType fromString(String tree) { if (tree == null || tree.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(tree); return parseSingleMediaType(tree, matcher, false); } MediaType(String type, String subtype); MediaType(String type, String su... |
@Test public void testParseList() { List<MediaType> mediaTypes = MediaType.parseList("text/html, image/png,**").collect(Collectors.toList()); assertEquals(asList(MediaType.TEXT_HTML.withParameter("a", "\"b,\""), MediaType.MATCH_ALL), mediaTypes2); } | public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaType(mediaType... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... |
@Test public void testParseSingleAsterix() { List<String> list = MediaType.parseList("text/html, image/gif, image/jpeg, *; q=.2, **", "*/*"), list); } | public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaType(mediaType... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... | MediaType { public static Stream<MediaType> parseList(String mediaTypeList) { if (mediaTypeList == null || mediaTypeList.isEmpty()) throw CONTAINER.missingMediaType(); Matcher matcher = TREE_PATTERN.matcher(mediaTypeList); List<MediaType> list = new ArrayList<>(); while (true) { MediaType mediaType = parseSingleMediaTy... |
@Test public void testToArray1() throws Exception { Object[] array = es.toArray(new Integer[1]); assertEquals(1, array.length); assertEquals(null, array[0]); array = es.toArray(new Integer[0]); assertEquals(0, array.length); } | @Override public Object[] toArray() { return new Object[0]; } | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primi... | EmptyIntSet extends AbstractImmutableIntSet { @Override public Object[] toArray() { return new Object[0]; } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Primi... |
@Test public void testMediaTypeMatch() { MediaType one = MediaType.APPLICATION_JSON; MediaType two = MediaType.APPLICATION_JSON; assertTrue(one.match(two)); assertTrue(two.match(one)); } | public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } } | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... |
@Test public void testMediaTypeUnMatch() { MediaType one = MediaType.APPLICATION_JSON; MediaType two = MediaType.APPLICATION_JAVASCRIPT; assertFalse(one.match(two)); assertFalse(two.match(one)); } | public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } } | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... |
@Test public void testMediaTypeMatchItself() { MediaType one = MediaType.APPLICATION_JSON; assertTrue(one.match(one)); } | public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } } | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... | MediaType { public boolean match(MediaType other) { if (other == this) return true; return other != null && (other.matchesAll() || this.matchesAll() || other.typeSubtype.equals(this.typeSubtype)); } MediaType(String type, String subtype); MediaType(String type, String subtype, Map<String, String> params); MediaType(S... |
@Test public void textToTextConversion() { String source = "All those moments will be lost in time, like tears in rain."; byte[] sourceAs8859 = source.getBytes(ISO_8859_1); byte[] sourceAsASCII = source.getBytes(US_ASCII); Object result = StandardConversions.convertTextToText(sourceAs8859, TEXT_PLAIN.withCharset(ISO_88... | public static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType) { if (source == null) return null; if (sourceType == null) throw new NullPointerException("MediaType cannot be null!"); if (!sourceType.match(MediaType.TEXT_PLAIN)) throw CONTAINER.invalidMediaType(TEXT_PLAIN_TYPE, so... | StandardConversions { public static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType) { if (source == null) return null; if (sourceType == null) throw new NullPointerException("MediaType cannot be null!"); if (!sourceType.match(MediaType.TEXT_PLAIN)) throw CONTAINER.invalidMediaTy... | StandardConversions { public static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType) { if (source == null) return null; if (sourceType == null) throw new NullPointerException("MediaType cannot be null!"); if (!sourceType.match(MediaType.TEXT_PLAIN)) throw CONTAINER.invalidMediaTy... | StandardConversions { public static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType) { if (source == null) return null; if (sourceType == null) throw new NullPointerException("MediaType cannot be null!"); if (!sourceType.match(MediaType.TEXT_PLAIN)) throw CONTAINER.invalidMediaTy... | StandardConversions { public static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType) { if (source == null) return null; if (sourceType == null) throw new NullPointerException("MediaType cannot be null!"); if (!sourceType.match(MediaType.TEXT_PLAIN)) throw CONTAINER.invalidMediaTy... |
@Test public void testTextToOctetStreamConversion() { String source = "Like our owl?"; byte[] result = StandardConversions.convertTextToOctetStream(source, TEXT_PLAIN); assertArrayEquals(source.getBytes(UTF_8), result); } | public static byte[] convertTextToOctetStream(Object source, MediaType sourceType) { if (source == null) return null; if (sourceType == null) { throw new NullPointerException("MediaType cannot be null!"); } if (source instanceof byte[]) return (byte[]) source; return source.toString().getBytes(sourceType.getCharset());... | StandardConversions { public static byte[] convertTextToOctetStream(Object source, MediaType sourceType) { if (source == null) return null; if (sourceType == null) { throw new NullPointerException("MediaType cannot be null!"); } if (source instanceof byte[]) return (byte[]) source; return source.toString().getBytes(sou... | StandardConversions { public static byte[] convertTextToOctetStream(Object source, MediaType sourceType) { if (source == null) return null; if (sourceType == null) { throw new NullPointerException("MediaType cannot be null!"); } if (source instanceof byte[]) return (byte[]) source; return source.toString().getBytes(sou... | StandardConversions { public static byte[] convertTextToOctetStream(Object source, MediaType sourceType) { if (source == null) return null; if (sourceType == null) { throw new NullPointerException("MediaType cannot be null!"); } if (source instanceof byte[]) return (byte[]) source; return source.toString().getBytes(sou... | StandardConversions { public static byte[] convertTextToOctetStream(Object source, MediaType sourceType) { if (source == null) return null; if (sourceType == null) { throw new NullPointerException("MediaType cannot be null!"); } if (source instanceof byte[]) return (byte[]) source; return source.toString().getBytes(sou... |
@Test public void testTextToObjectConversion() { String source = "Can the maker repair what he makes?"; String source2 = "I had your job once. I was good at it."; byte[] sourceBytes = source2.getBytes(US_ASCII); Object result = StandardConversions.convertTextToObject(source, APPLICATION_OBJECT); Object result2 = Standa... | public static String convertTextToObject(Object source, MediaType sourceType) { if (source == null) return null; if (source instanceof String) return source.toString(); if (source instanceof byte[]) { byte[] bytesSource = (byte[]) source; return new String(bytesSource, sourceType.getCharset()); } throw CONTAINER.invali... | StandardConversions { public static String convertTextToObject(Object source, MediaType sourceType) { if (source == null) return null; if (source instanceof String) return source.toString(); if (source instanceof byte[]) { byte[] bytesSource = (byte[]) source; return new String(bytesSource, sourceType.getCharset()); } ... | StandardConversions { public static String convertTextToObject(Object source, MediaType sourceType) { if (source == null) return null; if (source instanceof String) return source.toString(); if (source instanceof byte[]) { byte[] bytesSource = (byte[]) source; return new String(bytesSource, sourceType.getCharset()); } ... | StandardConversions { public static String convertTextToObject(Object source, MediaType sourceType) { if (source == null) return null; if (source instanceof String) return source.toString(); if (source instanceof byte[]) { byte[] bytesSource = (byte[]) source; return new String(bytesSource, sourceType.getCharset()); } ... | StandardConversions { public static String convertTextToObject(Object source, MediaType sourceType) { if (source == null) return null; if (source instanceof String) return source.toString(); if (source instanceof byte[]) { byte[] bytesSource = (byte[]) source; return new String(bytesSource, sourceType.getCharset()); } ... |
@Test public void testTextToURLEncodedConversion() throws UnsupportedEncodingException { String source = "They're either a benefit or a hazard. If they're a benefit, it's not my problem."; String result = StandardConversions.convertTextToUrlEncoded(source, TEXT_PLAIN.withCharset(UTF_16)); assertEquals(URLEncoder.encode... | public static String convertTextToUrlEncoded(Object source, MediaType sourceType) { return urlEncode(source, sourceType); } | StandardConversions { public static String convertTextToUrlEncoded(Object source, MediaType sourceType) { return urlEncode(source, sourceType); } } | StandardConversions { public static String convertTextToUrlEncoded(Object source, MediaType sourceType) { return urlEncode(source, sourceType); } } | StandardConversions { public static String convertTextToUrlEncoded(Object source, MediaType sourceType) { return urlEncode(source, sourceType); } static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType); static byte[] convertTextToOctetStream(Object source, MediaType sourceType);... | StandardConversions { public static String convertTextToUrlEncoded(Object source, MediaType sourceType) { return urlEncode(source, sourceType); } static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType); static byte[] convertTextToOctetStream(Object source, MediaType sourceType);... |
@Test public void testOctetStreamToTextConversion() { String text = "Have you ever retired a human by mistake?"; byte[] bytes1 = text.getBytes(); byte[] bytes2 = new byte[]{1, 2, 3}; byte[] result1 = StandardConversions.convertOctetStreamToText(bytes1, TEXT_PLAIN.withCharset(US_ASCII)); byte[] result2 = StandardConvers... | public static byte[] convertOctetStreamToText(byte[] source, MediaType destination) { if (source == null) return null; return convertCharset(source, UTF_8, destination.getCharset()); } | StandardConversions { public static byte[] convertOctetStreamToText(byte[] source, MediaType destination) { if (source == null) return null; return convertCharset(source, UTF_8, destination.getCharset()); } } | StandardConversions { public static byte[] convertOctetStreamToText(byte[] source, MediaType destination) { if (source == null) return null; return convertCharset(source, UTF_8, destination.getCharset()); } } | StandardConversions { public static byte[] convertOctetStreamToText(byte[] source, MediaType destination) { if (source == null) return null; return convertCharset(source, UTF_8, destination.getCharset()); } static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType); static byte[] c... | StandardConversions { public static byte[] convertOctetStreamToText(byte[] source, MediaType destination) { if (source == null) return null; return convertCharset(source, UTF_8, destination.getCharset()); } static Object convertTextToText(Object source, MediaType sourceType, MediaType destinationType); static byte[] c... |
@Test public void testOctetStreamToJavaConversion() { String value = "It's not an easy thing to meet your maker."; byte[] textStream = value.getBytes(UTF_8); byte[] randomBytes = new byte[]{23, 23, 34, 1, -1, -123}; Marshaller marshaller = new ProtoStreamMarshaller(); MediaType stringType = APPLICATION_OBJECT.withParam... | public static Object convertOctetStreamToJava(byte[] source, MediaType destination, Marshaller marshaller) { if (source == null) return null; if (!destination.match(MediaType.APPLICATION_OBJECT)) { throw CONTAINER.invalidMediaType(APPLICATION_OBJECT_TYPE, destination.toString()); } String classType = destination.getCla... | StandardConversions { public static Object convertOctetStreamToJava(byte[] source, MediaType destination, Marshaller marshaller) { if (source == null) return null; if (!destination.match(MediaType.APPLICATION_OBJECT)) { throw CONTAINER.invalidMediaType(APPLICATION_OBJECT_TYPE, destination.toString()); } String classTyp... | StandardConversions { public static Object convertOctetStreamToJava(byte[] source, MediaType destination, Marshaller marshaller) { if (source == null) return null; if (!destination.match(MediaType.APPLICATION_OBJECT)) { throw CONTAINER.invalidMediaType(APPLICATION_OBJECT_TYPE, destination.toString()); } String classTyp... | StandardConversions { public static Object convertOctetStreamToJava(byte[] source, MediaType destination, Marshaller marshaller) { if (source == null) return null; if (!destination.match(MediaType.APPLICATION_OBJECT)) { throw CONTAINER.invalidMediaType(APPLICATION_OBJECT_TYPE, destination.toString()); } String classTyp... | StandardConversions { public static Object convertOctetStreamToJava(byte[] source, MediaType destination, Marshaller marshaller) { if (source == null) return null; if (!destination.match(MediaType.APPLICATION_OBJECT)) { throw CONTAINER.invalidMediaType(APPLICATION_OBJECT_TYPE, destination.toString()); } String classTyp... |
@Test public void testJavaToTextConversion() { String string = "I've seen things you people wouldn't believe."; Double number = 12.1d; Calendar complex = Calendar.getInstance(); MediaType stringType = APPLICATION_OBJECT.withParameter("type", "java.lang.String"); byte[] result1 = StandardConversions.convertJavaToText(st... | public static byte[] convertJavaToText(Object source, MediaType sourceMediaType, MediaType destinationMediaType) { if (source == null) return null; if (sourceMediaType == null || destinationMediaType == null) { throw new NullPointerException("sourceMediaType and destinationMediaType cannot be null!"); } Object decoded ... | StandardConversions { public static byte[] convertJavaToText(Object source, MediaType sourceMediaType, MediaType destinationMediaType) { if (source == null) return null; if (sourceMediaType == null || destinationMediaType == null) { throw new NullPointerException("sourceMediaType and destinationMediaType cannot be null... | StandardConversions { public static byte[] convertJavaToText(Object source, MediaType sourceMediaType, MediaType destinationMediaType) { if (source == null) return null; if (sourceMediaType == null || destinationMediaType == null) { throw new NullPointerException("sourceMediaType and destinationMediaType cannot be null... | StandardConversions { public static byte[] convertJavaToText(Object source, MediaType sourceMediaType, MediaType destinationMediaType) { if (source == null) return null; if (sourceMediaType == null || destinationMediaType == null) { throw new NullPointerException("sourceMediaType and destinationMediaType cannot be null... | StandardConversions { public static byte[] convertJavaToText(Object source, MediaType sourceMediaType, MediaType destinationMediaType) { if (source == null) return null; if (sourceMediaType == null || destinationMediaType == null) { throw new NullPointerException("sourceMediaType and destinationMediaType cannot be null... |
@Test public void testContainsAll() throws Exception { IntSet sis2 = new SingletonIntSet(3); assertFalse(es.containsAll(sis2)); assertTrue(sis2.containsAll(es)); IntSet sis3 = new RangeSet(0); assertTrue(sis3.containsAll(es)); assertTrue(es.containsAll(sis3)); } | @Override public boolean containsAll(IntSet set) { return set.isEmpty(); } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { return set.isEmpty(); } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { return set.isEmpty(); } } | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { return set.isEmpty(); } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @O... | EmptyIntSet extends AbstractImmutableIntSet { @Override public boolean containsAll(IntSet set) { return set.isEmpty(); } static IntSet getInstance(); @Override boolean contains(int i); @Override boolean containsAll(IntSet set); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @O... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); int temp = faker.number().numberBetween(-50, 50); float decimal = (float)faker.number().randomDouble(5, 0, 1); SensorConfig config = new SensorConfig("someId", "nordic", null); ReplayProcessor<SensorLog> processor = ReplayProcessor.create(10); Temp... | @Override public void run(byte[] bytes) { float ambientTemp = decodeTemperature(bytes[0], bytes[1]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(TEMP_VALUE_ID, ambientTemp)); processor.onNext(sensorLog); } | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float ambientTemp = decodeTemperature(bytes[0], bytes[1]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(TEMP_VALUE_ID, ambientTemp)); processor.onNext(sensorLog); } } | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float ambientTemp = decodeTemperature(bytes[0], bytes[1]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(TEMP_VALUE_ID, ambientTemp)); processor.onNext(sensorLog); } TemperatureNotification... | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float ambientTemp = decodeTemperature(bytes[0], bytes[1]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(TEMP_VALUE_ID, ambientTemp)); processor.onNext(sensorLog); } TemperatureNotification... | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float ambientTemp = decodeTemperature(bytes[0], bytes[1]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(TEMP_VALUE_ID, ambientTemp)); processor.onNext(sensorLog); } TemperatureNotification... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); int red = faker.number().numberBetween(0, 32768); int green = faker.number().numberBetween(0, 32768); int blue = faker.number().numberBetween(0, 32768); int clear = faker.number().numberBetween(0, 32768); SensorConfig config = new SensorConfig("som... | @Override public void run(byte[] bytes) { int red = decodeColor(bytes[1], bytes[0]); int green = decodeColor(bytes[3], bytes[2]); int blue = decodeColor(bytes[5], bytes[4]); int clear = decodeColor(bytes[7], bytes[6]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(COLOUR_RED_VALUE_ID, red, COLOUR_... | ColorNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int red = decodeColor(bytes[1], bytes[0]); int green = decodeColor(bytes[3], bytes[2]); int blue = decodeColor(bytes[5], bytes[4]); int clear = decodeColor(bytes[7], bytes[6]); SensorLog sensorLog = new SensorLog(conf... | ColorNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int red = decodeColor(bytes[1], bytes[0]); int green = decodeColor(bytes[3], bytes[2]); int blue = decodeColor(bytes[5], bytes[4]); int clear = decodeColor(bytes[7], bytes[6]); SensorLog sensorLog = new SensorLog(conf... | ColorNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int red = decodeColor(bytes[1], bytes[0]); int green = decodeColor(bytes[3], bytes[2]); int blue = decodeColor(bytes[5], bytes[4]); int clear = decodeColor(bytes[7], bytes[6]); SensorLog sensorLog = new SensorLog(conf... | ColorNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int red = decodeColor(bytes[1], bytes[0]); int green = decodeColor(bytes[3], bytes[2]); int blue = decodeColor(bytes[5], bytes[4]); int clear = decodeColor(bytes[7], bytes[6]); SensorLog sensorLog = new SensorLog(conf... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); int humidity = faker.number().numberBetween(0, 100); SensorConfig config = new SensorConfig("someId", "", null); ReplayProcessor<SensorLog> processor = ReplayProcessor.create(10); HumidityNotification notification = new HumidityNotification(config,... | @Override public void run(byte[] bytes) { int relativeHumidity = decodeHumidity(bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("relative_humidity", relativeHumidity)); processor.onNext(sensorLog); } | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int relativeHumidity = decodeHumidity(bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("relative_humidity", relativeHumidity)); processor.onNext(sensorLog); } } | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int relativeHumidity = decodeHumidity(bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("relative_humidity", relativeHumidity)); processor.onNext(sensorLog); } HumidityNotification(Sens... | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int relativeHumidity = decodeHumidity(bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("relative_humidity", relativeHumidity)); processor.onNext(sensorLog); } HumidityNotification(Sens... | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int relativeHumidity = decodeHumidity(bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("relative_humidity", relativeHumidity)); processor.onNext(sensorLog); } HumidityNotification(Sens... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); int pressure = faker.number().numberBetween(-100000, 100000); float decimal = (float)faker.number().randomDouble(4, 0, 1); byte[] pressureBytes = Ints.toByteArray(pressure); SensorConfig config = new SensorConfig("someId", "thingy",null); ReplayPro... | @Override public void run(byte[] bytes) { float pressure = decodePressure(bytes); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(PRESSURE_VALUE_ID, pressure)); processor.onNext(sensorLog); } | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(bytes); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(PRESSURE_VALUE_ID, pressure)); processor.onNext(sensorLog); } } | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(bytes); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(PRESSURE_VALUE_ID, pressure)); processor.onNext(sensorLog); } PressureNotification(SensorConfig config, Fl... | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(bytes); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(PRESSURE_VALUE_ID, pressure)); processor.onNext(sensorLog); } PressureNotification(SensorConfig config, Fl... | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(bytes); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(PRESSURE_VALUE_ID, pressure)); processor.onNext(sensorLog); } PressureNotification(SensorConfig config, Fl... |
@Test public void producesValidSensorLog() { int eCO2 = 400; byte[] eCO2bytes = Ints.toByteArray(eCO2); int TVOC = 121; byte[] TVOCbytes = Ints.toByteArray(TVOC); SensorConfig config = new SensorConfig("someId", "sensortag", null); ReplayProcessor<SensorLog> processor = ReplayProcessor.create(10); AirQualityNotificatio... | @Override public void run(byte[] bytes) { int eCO2 = decodeECO2(bytes[1], bytes[0]); int tvoc = decodeTVOC(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(CO2_VALUE_ID, eCO2, TVOC_VALUE_ID, tvoc)); processor.onNext(sensorLog); } | AirQualityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int eCO2 = decodeECO2(bytes[1], bytes[0]); int tvoc = decodeTVOC(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(CO2_VALUE_ID, eCO2, TVOC_VALUE_ID, tvoc)); processor.onNex... | AirQualityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int eCO2 = decodeECO2(bytes[1], bytes[0]); int tvoc = decodeTVOC(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(CO2_VALUE_ID, eCO2, TVOC_VALUE_ID, tvoc)); processor.onNex... | AirQualityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int eCO2 = decodeECO2(bytes[1], bytes[0]); int tvoc = decodeTVOC(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(CO2_VALUE_ID, eCO2, TVOC_VALUE_ID, tvoc)); processor.onNex... | AirQualityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { int eCO2 = decodeECO2(bytes[1], bytes[0]); int tvoc = decodeTVOC(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(CO2_VALUE_ID, eCO2, TVOC_VALUE_ID, tvoc)); processor.onNex... |
@Test public void testSensorTask() throws IOException { SensorConfig webSensorConfig1 = new SensorConfig("web", ImmutableMap.of( WebSensor.CONFIG_KEY_FAMILY, "wasp", WebSensor.CONFIG_KEY_SENSOR, "ES_B_05_416_7C15", WebSensor.CONFIG_KEY_SUB_SENSOR, "BAT" )); MockWebServer server = new MockWebServer(); server.enqueue(new... | public List<String[]> pollSensor() { setDatesPollInterval(); List<String[]> data = null; Call<List<String[]>> call = webApi.getHcJsonData(getQueryParameters()); try { data = call.execute().body(); for (String[] dataArray: data) { log.info("Time: " + dataArray[0] + " Data: " + dataArray[1]); SensorLog sensorLog = new Se... | WebSensorTask extends TimerTask { public List<String[]> pollSensor() { setDatesPollInterval(); List<String[]> data = null; Call<List<String[]>> call = webApi.getHcJsonData(getQueryParameters()); try { data = call.execute().body(); for (String[] dataArray: data) { log.info("Time: " + dataArray[0] + " Data: " + dataArray... | WebSensorTask extends TimerTask { public List<String[]> pollSensor() { setDatesPollInterval(); List<String[]> data = null; Call<List<String[]>> call = webApi.getHcJsonData(getQueryParameters()); try { data = call.execute().body(); for (String[] dataArray: data) { log.info("Time: " + dataArray[0] + " Data: " + dataArray... | WebSensorTask extends TimerTask { public List<String[]> pollSensor() { setDatesPollInterval(); List<String[]> data = null; Call<List<String[]>> call = webApi.getHcJsonData(getQueryParameters()); try { data = call.execute().body(); for (String[] dataArray: data) { log.info("Time: " + dataArray[0] + " Data: " + dataArray... | WebSensorTask extends TimerTask { public List<String[]> pollSensor() { setDatesPollInterval(); List<String[]> data = null; Call<List<String[]>> call = webApi.getHcJsonData(getQueryParameters()); try { data = call.execute().body(); for (String[] dataArray: data) { log.info("Time: " + dataArray[0] + " Data: " + dataArray... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); int mantissa = faker.number().numberBetween(0, 4096); int exponent = faker.number().numberBetween(0, 16); float lux = mantissa * (float)Math.pow(2, exponent) / 100.0f; SensorConfig config = new SensorConfig("someId", "thingy", null); ReplayProcesso... | @Override public void run(byte[] bytes) { float lux = decodeLux(bytes[1], bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(LIGHT_INTENSITY_VALUE_ID, lux)); processor.onNext(sensorLog); } | OpticalNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float lux = decodeLux(bytes[1], bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(LIGHT_INTENSITY_VALUE_ID, lux)); processor.onNext(sensorLog); } } | OpticalNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float lux = decodeLux(bytes[1], bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(LIGHT_INTENSITY_VALUE_ID, lux)); processor.onNext(sensorLog); } OpticalNotification(SensorConfig config,... | OpticalNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float lux = decodeLux(bytes[1], bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(LIGHT_INTENSITY_VALUE_ID, lux)); processor.onNext(sensorLog); } OpticalNotification(SensorConfig config,... | OpticalNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float lux = decodeLux(bytes[1], bytes[0]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(LIGHT_INTENSITY_VALUE_ID, lux)); processor.onNext(sensorLog); } OpticalNotification(SensorConfig config,... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); int objectTemp = faker.number().numberBetween(-50, 50); float objectTempDecimal = (float)faker.number().randomDouble(4, 0, 1); int ambientTemp = faker.number().numberBetween(-50, 50); float ambientTempDecimal = (float)faker.number().randomDouble(4,... | @Override public void run(byte[] bytes) { float objectTemp = decodeTemperature(bytes[1], bytes[0]); float ambientTemp = decodeTemperature(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(OBJECT_TEMP_VALUE_ID, objectTemp, AMBIENT_TEMP_VALUE_ID, ambientTemp)); processor.onNext(sens... | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float objectTemp = decodeTemperature(bytes[1], bytes[0]); float ambientTemp = decodeTemperature(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(OBJECT_TEMP_VALUE_ID, obje... | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float objectTemp = decodeTemperature(bytes[1], bytes[0]); float ambientTemp = decodeTemperature(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(OBJECT_TEMP_VALUE_ID, obje... | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float objectTemp = decodeTemperature(bytes[1], bytes[0]); float ambientTemp = decodeTemperature(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(OBJECT_TEMP_VALUE_ID, obje... | TemperatureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float objectTemp = decodeTemperature(bytes[1], bytes[0]); float ambientTemp = decodeTemperature(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(OBJECT_TEMP_VALUE_ID, obje... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); double humidity = faker.number().randomDouble(4, 0, 50); int humidityNorm = (int)(humidity * 65536 / 100); double temperature = faker.number().randomDouble(4, -50, 50); int temperatureNorm = (int)((temperature + 40) / 165 * 65536); SensorConfig con... | @Override public void run(byte[] bytes) { float temperature = decodeTemperature(bytes[1], bytes[0]); float humidity = decodeHumidity(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(HUMIDITY_VALUE_ID, humidity, TEMPERATURE_VALUE_ID, temperature)); processor.onNext(sensorLog); } | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float temperature = decodeTemperature(bytes[1], bytes[0]); float humidity = decodeHumidity(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(HUMIDITY_VALUE_ID, humidity, TEMPE... | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float temperature = decodeTemperature(bytes[1], bytes[0]); float humidity = decodeHumidity(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(HUMIDITY_VALUE_ID, humidity, TEMPE... | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float temperature = decodeTemperature(bytes[1], bytes[0]); float humidity = decodeHumidity(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(HUMIDITY_VALUE_ID, humidity, TEMPE... | HumidityNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float temperature = decodeTemperature(bytes[1], bytes[0]); float humidity = decodeHumidity(bytes[3], bytes[2]); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of(HUMIDITY_VALUE_ID, humidity, TEMPE... |
@Test public void producesValidSensorLog() { Faker faker = new Faker(); double pressure = faker.number().randomDouble(2, 0, 5000); int pressureNorm = (int)(pressure * 100); SensorConfig config = new SensorConfig("someId", "sensortag",null); ReplayProcessor<SensorLog> processor = ReplayProcessor.create(10); PressureNoti... | @Override public void run(byte[] bytes) { float pressure = decodePressure(new byte[]{0x00, bytes[5], bytes[4], bytes[3]}); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("pressure", pressure)); processor.onNext(sensorLog); } | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(new byte[]{0x00, bytes[5], bytes[4], bytes[3]}); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("pressure", pressure)); processor.onNext(sensorLog); } } | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(new byte[]{0x00, bytes[5], bytes[4], bytes[3]}); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("pressure", pressure)); processor.onNext(sensorLog); } PressureNo... | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(new byte[]{0x00, bytes[5], bytes[4], bytes[3]}); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("pressure", pressure)); processor.onNext(sensorLog); } PressureNo... | PressureNotification implements BluetoothNotification<byte[]> { @Override public void run(byte[] bytes) { float pressure = decodePressure(new byte[]{0x00, bytes[5], bytes[4], bytes[3]}); SensorLog sensorLog = new SensorLog(config.getId(), ImmutableMap.of("pressure", pressure)); processor.onNext(sensorLog); } PressureNo... |
@Test public void testSPI() { HmilyTestSPI hmilyTestSPI = ExtensionLoaderFactory.load(HmilyTestSPI.class); assertThat(hmilyTestSPI.getClass().getName(), is(NoHelloTestSPI.class.getName())); HmilyTestSPI test2 = ExtensionLoaderFactory.load(HmilyTestSPI.class); assertThat(test2.getClass().getName(), is(NoHelloTestSPI.cla... | public static <T> T load(final Class<T> service) { return ExtensionLoader.getExtensionLoader(service).load(findClassLoader()); } | ExtensionLoaderFactory { public static <T> T load(final Class<T> service) { return ExtensionLoader.getExtensionLoader(service).load(findClassLoader()); } } | ExtensionLoaderFactory { public static <T> T load(final Class<T> service) { return ExtensionLoader.getExtensionLoader(service).load(findClassLoader()); } } | ExtensionLoaderFactory { public static <T> T load(final Class<T> service) { return ExtensionLoader.getExtensionLoader(service).load(findClassLoader()); } static T load(final Class<T> service); static T load(final Class<T> service, final String name); static T load(final Class<T> service, final ClassLoader loader); sta... | ExtensionLoaderFactory { public static <T> T load(final Class<T> service) { return ExtensionLoader.getExtensionLoader(service).load(findClassLoader()); } static T load(final Class<T> service); static T load(final Class<T> service, final String name); static T load(final Class<T> service, final ClassLoader loader); sta... |
@Test public void testApolloLoad() { ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); ApolloConfigLoader apolloConfigLoader = new ApolloConfigLoader(client); loader.load(ConfigLoader.Context::new, (context, config) -> { if (config != null) { if (StringUtils.isNoneBlank(config.getConfigMode())) {... | private void apolloLoad(final Supplier<Context> context, final LoaderHandler<ApolloConfig> handler, final ApolloConfig config) { if (config != null) { check(config); LOGGER.info("loader apollo config: {}", config); String fileExtension = config.getFileExtension(); PropertyLoader propertyLoader = LOADERS.get(fileExtensi... | ApolloConfigLoader implements ConfigLoader<ApolloConfig> { private void apolloLoad(final Supplier<Context> context, final LoaderHandler<ApolloConfig> handler, final ApolloConfig config) { if (config != null) { check(config); LOGGER.info("loader apollo config: {}", config); String fileExtension = config.getFileExtension... | ApolloConfigLoader implements ConfigLoader<ApolloConfig> { private void apolloLoad(final Supplier<Context> context, final LoaderHandler<ApolloConfig> handler, final ApolloConfig config) { if (config != null) { check(config); LOGGER.info("loader apollo config: {}", config); String fileExtension = config.getFileExtension... | ApolloConfigLoader implements ConfigLoader<ApolloConfig> { private void apolloLoad(final Supplier<Context> context, final LoaderHandler<ApolloConfig> handler, final ApolloConfig config) { if (config != null) { check(config); LOGGER.info("loader apollo config: {}", config); String fileExtension = config.getFileExtension... | ApolloConfigLoader implements ConfigLoader<ApolloConfig> { private void apolloLoad(final Supplier<Context> context, final LoaderHandler<ApolloConfig> handler, final ApolloConfig config) { if (config != null) { check(config); LOGGER.info("loader apollo config: {}", config); String fileExtension = config.getFileExtension... |
@Test public void testNacosLoad() { ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); NacosConfigLoader nacosConfigLoader = new NacosConfigLoader(client); loader.load(ConfigLoader.Context::new, (context, config) -> { if (config != null) { if (StringUtils.isNoneBlank(config.getConfigMode())) { Str... | private void nacosLoad(final Supplier<Context> context, final LoaderHandler<NacosConfig> handler, final NacosConfig config) { if (config != null) { check(config); LOGGER.info("loader nacos config: {}", config); String fileExtension = config.getFileExtension(); PropertyLoader propertyLoader = LOADERS.get(fileExtension);... | NacosConfigLoader implements ConfigLoader<NacosConfig> { private void nacosLoad(final Supplier<Context> context, final LoaderHandler<NacosConfig> handler, final NacosConfig config) { if (config != null) { check(config); LOGGER.info("loader nacos config: {}", config); String fileExtension = config.getFileExtension(); Pr... | NacosConfigLoader implements ConfigLoader<NacosConfig> { private void nacosLoad(final Supplier<Context> context, final LoaderHandler<NacosConfig> handler, final NacosConfig config) { if (config != null) { check(config); LOGGER.info("loader nacos config: {}", config); String fileExtension = config.getFileExtension(); Pr... | NacosConfigLoader implements ConfigLoader<NacosConfig> { private void nacosLoad(final Supplier<Context> context, final LoaderHandler<NacosConfig> handler, final NacosConfig config) { if (config != null) { check(config); LOGGER.info("loader nacos config: {}", config); String fileExtension = config.getFileExtension(); Pr... | NacosConfigLoader implements ConfigLoader<NacosConfig> { private void nacosLoad(final Supplier<Context> context, final LoaderHandler<NacosConfig> handler, final NacosConfig config) { if (config != null) { check(config); LOGGER.info("loader nacos config: {}", config); String fileExtension = config.getFileExtension(); Pr... |
@Test public void load() { ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); loader.load(ConfigLoader.Context::new, (context, config) -> { System.out.println("config:---->" + config); if (config != null) { if (StringUtils.isNotBlank(config.getConfigMode())) { String configMode = config.getConfigM... | @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); } | LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); } } | LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); } } | LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); } @Override void load(final Supplier<Context> context, final LoaderHandler... | LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); } @Override void load(final Supplier<Context> context, final LoaderHandler... |
@Test @Ignore public void realZookeeperLoad() { ZookeeperConfig remoteConfig = new ZookeeperConfig(); remoteConfig.setServerList("127.0.0.1:2181"); CuratorZookeeperClient client = CuratorZookeeperClient.getInstance(remoteConfig); client.persist("/hmily/xiaoyu", FileUtils.readYAML("hmily-zookeeper.yml")); ConfigScan.sca... | @Override public void load(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler) { LoaderHandler<ZookeeperConfig> zookeeperLoad = (c, config) -> zookeeperLoad(c, handler, config); againLoad(context, zookeeperLoad, ZookeeperConfig.class); } | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { @Override public void load(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler) { LoaderHandler<ZookeeperConfig> zookeeperLoad = (c, config) -> zookeeperLoad(c, handler, config); againLoad(context, zookeeperLoad, ZookeeperConfig.... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { @Override public void load(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler) { LoaderHandler<ZookeeperConfig> zookeeperLoad = (c, config) -> zookeeperLoad(c, handler, config); againLoad(context, zookeeperLoad, ZookeeperConfig.... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { @Override public void load(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler) { LoaderHandler<ZookeeperConfig> zookeeperLoad = (c, config) -> zookeeperLoad(c, handler, config); againLoad(context, zookeeperLoad, ZookeeperConfig.... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { @Override public void load(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler) { LoaderHandler<ZookeeperConfig> zookeeperLoad = (c, config) -> zookeeperLoad(c, handler, config); againLoad(context, zookeeperLoad, ZookeeperConfig.... |
@Test public void testZookeeperLoad() { ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); loader.load(ConfigLoader.Context::new, (context, config) -> { System.out.println("config:---->" + config); if (config != null) { if (StringUtils.isNotBlank(config.getConfigMode())) { String configMode = conf... | private void zookeeperLoad(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler, final ZookeeperConfig config) { if (config != null) { check(config); if (Objects.isNull(client)) { client = CuratorZookeeperClient.getInstance(config); } if (config.isUpdate()) { client.persist(config.getPath(), Fi... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { private void zookeeperLoad(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler, final ZookeeperConfig config) { if (config != null) { check(config); if (Objects.isNull(client)) { client = CuratorZookeeperClient.getInstance(config... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { private void zookeeperLoad(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler, final ZookeeperConfig config) { if (config != null) { check(config); if (Objects.isNull(client)) { client = CuratorZookeeperClient.getInstance(config... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { private void zookeeperLoad(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler, final ZookeeperConfig config) { if (config != null) { check(config); if (Objects.isNull(client)) { client = CuratorZookeeperClient.getInstance(config... | ZookeeperConfigLoader implements ConfigLoader<ZookeeperConfig> { private void zookeeperLoad(final Supplier<Context> context, final LoaderHandler<ZookeeperConfig> handler, final ZookeeperConfig config) { if (config != null) { check(config); if (Objects.isNull(client)) { client = CuratorZookeeperClient.getInstance(config... |
@Test public void testIsNoneBlank() { Assert.assertFalse(StringUtils.isNoneBlank((CharSequence) null)); Assert.assertFalse(StringUtils.isNoneBlank("")); Assert.assertFalse(StringUtils.isNoneBlank("", "", "")); Assert.assertTrue(StringUtils.isNoneBlank("a", "b", "c")); } | public static boolean isNoneBlank(final CharSequence... css) { return !isAnyBlank(css); } | StringUtils { public static boolean isNoneBlank(final CharSequence... css) { return !isAnyBlank(css); } } | StringUtils { public static boolean isNoneBlank(final CharSequence... css) { return !isAnyBlank(css); } } | StringUtils { public static boolean isNoneBlank(final CharSequence... css) { return !isAnyBlank(css); } static boolean isNoneBlank(final CharSequence... css); static boolean isEmpty(final Object[] array); static boolean isBlank(final CharSequence cs); } | StringUtils { public static boolean isNoneBlank(final CharSequence... css) { return !isAnyBlank(css); } static boolean isNoneBlank(final CharSequence... css); static boolean isEmpty(final Object[] array); static boolean isBlank(final CharSequence cs); } |
@Test public void testIsEmpty() { Assert.assertTrue(true); Assert.assertTrue(StringUtils.isEmpty(new String[0])); Assert.assertFalse(StringUtils.isEmpty(new String[]{"a", "b", "c"})); } | public static boolean isEmpty(final Object[] array) { return array == null || array.length == 0; } | StringUtils { public static boolean isEmpty(final Object[] array) { return array == null || array.length == 0; } } | StringUtils { public static boolean isEmpty(final Object[] array) { return array == null || array.length == 0; } } | StringUtils { public static boolean isEmpty(final Object[] array) { return array == null || array.length == 0; } static boolean isNoneBlank(final CharSequence... css); static boolean isEmpty(final Object[] array); static boolean isBlank(final CharSequence cs); } | StringUtils { public static boolean isEmpty(final Object[] array) { return array == null || array.length == 0; } static boolean isNoneBlank(final CharSequence... css); static boolean isEmpty(final Object[] array); static boolean isBlank(final CharSequence cs); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.