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 public void testIsBlank() { Assert.assertTrue(StringUtils.isBlank(null)); Assert.assertTrue(StringUtils.isBlank("")); Assert.assertTrue(StringUtils.isBlank(" ")); Assert.assertFalse(StringUtils.isBlank("foobar")); Assert.assertFalse(StringUtils.isBlank("foo bar")); }
public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(cs.charAt(i))) { return false; } } return true; }
StringUtils { public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(cs.charAt(i))) { return false; } } return true; } }
StringUtils { public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(cs.charAt(i))) { return false; } } return true; } }
StringUtils { public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(cs.charAt(i))) { return false; } } return true; } static boolean isNoneBlank(final CharSequence... css); static...
StringUtils { public static boolean isBlank(final CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(cs.charAt(i))) { return false; } } return true; } static boolean isNoneBlank(final CharSequence... css); static...
@Test public void testEtcdLoad() { ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); EtcdConfigLoader etcdConfigLoader = new EtcdConfigLoader(client); loader.load(ConfigLoader.Context::new, (context, config) -> { if (config != null) { if (StringUtils.isNoneBlank(config.getConfigMode())) { String ...
private void etcdLoad(final Supplier<Context> context, final LoaderHandler<EtcdConfig> handler, final EtcdConfig config) { if (config != null) { check(config); LOGGER.info("loader etcd config: {}", config); String fileExtension = config.getFileExtension(); PropertyLoader propertyLoader = LOADERS.get(fileExtension); if ...
EtcdConfigLoader implements ConfigLoader<EtcdConfig> { private void etcdLoad(final Supplier<Context> context, final LoaderHandler<EtcdConfig> handler, final EtcdConfig config) { if (config != null) { check(config); LOGGER.info("loader etcd config: {}", config); String fileExtension = config.getFileExtension(); Property...
EtcdConfigLoader implements ConfigLoader<EtcdConfig> { private void etcdLoad(final Supplier<Context> context, final LoaderHandler<EtcdConfig> handler, final EtcdConfig config) { if (config != null) { check(config); LOGGER.info("loader etcd config: {}", config); String fileExtension = config.getFileExtension(); Property...
EtcdConfigLoader implements ConfigLoader<EtcdConfig> { private void etcdLoad(final Supplier<Context> context, final LoaderHandler<EtcdConfig> handler, final EtcdConfig config) { if (config != null) { check(config); LOGGER.info("loader etcd config: {}", config); String fileExtension = config.getFileExtension(); Property...
EtcdConfigLoader implements ConfigLoader<EtcdConfig> { private void etcdLoad(final Supplier<Context> context, final LoaderHandler<EtcdConfig> handler, final EtcdConfig config) { if (config != null) { check(config); LOGGER.info("loader etcd config: {}", config); String fileExtension = config.getFileExtension(); Property...
@Test public void testJavaBeanBind() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.stringTest", "123"); map.put("hmily.integerTest", 456); map.put("hmily.doubleTest", 42.12); map.put("hmily.longTest", 100L); map.put("hmily.chartTest", 'a'); map.put("hmily.floatTest", 12.1F); map...
@Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if (bean == null) { return null; } Bea...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
@Test public void testJavaBeanBindParse() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.stringTest", 123); map.put("hmily.integerTest", "123"); map.put("hmily.doubleTest", "123"); map.put("hmily.longTest", "123"); map.put("hmily.chartTest", "A"); map.put("hmily.floatTest", "123"...
@Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if (bean == null) { return null; } Bea...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
JavaBeanBinder extends BeanBinder { @Override public <T> T bind(final PropertyName name, final BindData<T> target, final Binder.Env env, final PropertyBinder propertyBinder) { boolean hasKnownBindableProperties = env.getSource().containsDescendantOf(name); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if...
@Test public void testMap() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.map.userName", "sixh"); map.put("hmily.map.passWord", 123456); PropertyKeySource<?> propertySource = new MapPropertyKeySource(name, map); ConfigPropertySource configPropertySource = new DefaultConfigProper...
@Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(propertyName); if (!hasDescendants) { new EntryBinder(pro...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
@Test public void testMapGeneric() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.map2.userName", "456"); map.put("hmily.map2.passWord", 123456); PropertyKeySource<?> propertySource = new MapPropertyKeySource(name, map); ConfigPropertySource configPropertySource = new DefaultConf...
@Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(propertyName); if (!hasDescendants) { new EntryBinder(pro...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
MapBinder extends AggregateBinder<Map<Object, Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { Map<Object, Object> map = new HashMap<>(16); boolean hasDescendants = env.getSource().containsDescendantOf(...
@Test public void testArrayList() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.list[0]", 123); map.put("hmily.list[1]", 234); PropertyKeySource<?> propertySource = new MapPropertyKeySource(name, map); ConfigPropertySource configPropertySource = new DefaultConfigPropertySource<>...
@Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : type.getTypeClass(); DataType aggregateType = DataType.of(colle...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
@Test public void testNotSetArrayList() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.list[0]", 123); map.put("hmily.list[1]", 234); PropertyKeySource<?> propertySource = new MapPropertyKeySource(name, map); ConfigPropertySource configPropertySource = new DefaultConfigPropertySo...
@Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : type.getTypeClass(); DataType aggregateType = DataType.of(colle...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
@Test public void testListGeneric() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.list2[0]", "123"); map.put("hmily.list2[1]", 234); PropertyKeySource<?> propertySource = new MapPropertyKeySource(name, map); ConfigPropertySource configPropertySource = new DefaultConfigPropertySo...
@Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : type.getTypeClass(); DataType aggregateType = DataType.of(colle...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
@Test public void testArray() { String name = "hmily.yml"; Map<String, Object> map = new HashMap<>(); map.put("hmily.intArray[0]", 123); map.put("hmily.intArray[1]", 234); PropertyKeySource<?> propertySource = new MapPropertyKeySource(name, map); ConfigPropertySource configPropertySource = new DefaultConfigPropertySour...
@Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : type.getTypeClass(); DataType aggregateType = DataType.of(colle...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
CollectionBinder extends IndexedBinder<Collection<Object>> { @Override public Object bind(final PropertyName propertyName, final BindData<?> target, final Binder.Env env, final AggregateElementBinder elementBinder) { DataType type = target.getType(); Class<?> collectionType = target.getValue() != null ? List.class : ty...
@Test public void testOdd() { assertTrue(MathUtil.isOdd(3)); assertFalse(MathUtil.isOdd(4)); }
public static boolean isOdd(int number) { return number % 2 == 1; }
MathUtil { public static boolean isOdd(int number) { return number % 2 == 1; } }
MathUtil { public static boolean isOdd(int number) { return number % 2 == 1; } }
MathUtil { public static boolean isOdd(int number) { return number % 2 == 1; } static boolean isOdd(int number); }
MathUtil { public static boolean isOdd(int number) { return number % 2 == 1; } static boolean isOdd(int number); }
@Test public void computeTrueAnswers() throws Exception { File configFile = File.createTempFile("test-workload", "toml"); configFile.deleteOnExit(); try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(configFile.getAbsolutePath()))) { writer.write("directory = \"/tmp\"\n" + "[data]\n" + "tstart = 0\n" + "ten...
static void computeTrueAnswers(Configuration conf, Workload workload) throws Exception { long T0 = conf.getTstart(), T1 = conf.getTend(); ArrayList<LongRange> intervals = new ArrayList<>(); ArrayList<Query> queries = new ArrayList<>(); for (List<Query> classQueries: workload.values()) { for (Query q: classQueries) { qu...
LRMSPopulateWorkload { static void computeTrueAnswers(Configuration conf, Workload workload) throws Exception { long T0 = conf.getTstart(), T1 = conf.getTend(); ArrayList<LongRange> intervals = new ArrayList<>(); ArrayList<Query> queries = new ArrayList<>(); for (List<Query> classQueries: workload.values()) { for (Quer...
LRMSPopulateWorkload { static void computeTrueAnswers(Configuration conf, Workload workload) throws Exception { long T0 = conf.getTstart(), T1 = conf.getTend(); ArrayList<LongRange> intervals = new ArrayList<>(); ArrayList<Query> queries = new ArrayList<>(); for (List<Query> classQueries: workload.values()) { for (Quer...
LRMSPopulateWorkload { static void computeTrueAnswers(Configuration conf, Workload workload) throws Exception { long T0 = conf.getTstart(), T1 = conf.getTend(); ArrayList<LongRange> intervals = new ArrayList<>(); ArrayList<Query> queries = new ArrayList<>(); for (List<Query> classQueries: workload.values()) { for (Quer...
LRMSPopulateWorkload { static void computeTrueAnswers(Configuration conf, Workload workload) throws Exception { long T0 = conf.getTstart(), T1 = conf.getTend(); ArrayList<LongRange> intervals = new ArrayList<>(); ArrayList<Query> queries = new ArrayList<>(); for (List<Query> classQueries: workload.values()) { for (Quer...
@Test public void getFirstContainingTime() throws Exception { GenericWindowing exp = new GenericWindowing(new ExponentialWindowLengths(2)); assertEquals(101, exp.getFirstContainingTime(98, 99, 100)); assertEquals(103, exp.getFirstContainingTime(96, 99, 100)); assertEquals(107, exp.getFirstContainingTime(92, 99, 100)); ...
@Override public long getFirstContainingTime(long Tl, long Tr, long T) { assert 0 <= Tl && Tl <= Tr && Tr < T; long l = T-1 - Tr, r = T-1 - Tl, length = Tr - Tl + 1; if (!addWindowsUntilLength(length)) { return -1; } long firstMarker = firstWindowOfLength.ceilingEntry(length).getValue(); if (firstMarker >= l) { return ...
GenericWindowing implements Windowing { @Override public long getFirstContainingTime(long Tl, long Tr, long T) { assert 0 <= Tl && Tl <= Tr && Tr < T; long l = T-1 - Tr, r = T-1 - Tl, length = Tr - Tl + 1; if (!addWindowsUntilLength(length)) { return -1; } long firstMarker = firstWindowOfLength.ceilingEntry(length).get...
GenericWindowing implements Windowing { @Override public long getFirstContainingTime(long Tl, long Tr, long T) { assert 0 <= Tl && Tl <= Tr && Tr < T; long l = T-1 - Tr, r = T-1 - Tl, length = Tr - Tl + 1; if (!addWindowsUntilLength(length)) { return -1; } long firstMarker = firstWindowOfLength.ceilingEntry(length).get...
GenericWindowing implements Windowing { @Override public long getFirstContainingTime(long Tl, long Tr, long T) { assert 0 <= Tl && Tl <= Tr && Tr < T; long l = T-1 - Tr, r = T-1 - Tl, length = Tr - Tl + 1; if (!addWindowsUntilLength(length)) { return -1; } long firstMarker = firstWindowOfLength.ceilingEntry(length).get...
GenericWindowing implements Windowing { @Override public long getFirstContainingTime(long Tl, long Tr, long T) { assert 0 <= Tl && Tl <= Tr && Tr < T; long l = T-1 - Tr, r = T-1 - Tl, length = Tr - Tl + 1; if (!addWindowsUntilLength(length)) { return -1; } long firstMarker = firstWindowOfLength.ceilingEntry(length).get...
@Test public void getSizeOfFirstWindow() throws Exception { GenericWindowing exp = new GenericWindowing(new ExponentialWindowLengths(2)); assertEquals(1, exp.getSizeOfFirstWindow(), 1); final long S = 2492; GenericWindowing rp = new GenericWindowing(new WindowLengthsSequence() { private long i = 1; @Override public lon...
@Override public long getSizeOfFirstWindow() { return firstWindowLength; }
GenericWindowing implements Windowing { @Override public long getSizeOfFirstWindow() { return firstWindowLength; } }
GenericWindowing implements Windowing { @Override public long getSizeOfFirstWindow() { return firstWindowLength; } GenericWindowing(WindowLengthsSequence windowLengths); }
GenericWindowing implements Windowing { @Override public long getSizeOfFirstWindow() { return firstWindowLength; } GenericWindowing(WindowLengthsSequence windowLengths); @Override long getFirstContainingTime(long Tl, long Tr, long T); @Override long getSizeOfFirstWindow(); @Override List<Long> getWindowsCoveringUpto(lo...
GenericWindowing implements Windowing { @Override public long getSizeOfFirstWindow() { return firstWindowLength; } GenericWindowing(WindowLengthsSequence windowLengths); @Override long getFirstContainingTime(long Tl, long Tr, long T); @Override long getSizeOfFirstWindow(); @Override List<Long> getWindowsCoveringUpto(lo...
@Test public void getWindowsCoveringUpto() throws Exception { GenericWindowing exp = new GenericWindowing(new ExponentialWindowLengths(2)); assertThat(exp.getWindowsCoveringUpto(62), is(Arrays.asList(1L, 2L, 4L, 8L, 16L))); assertThat(exp.getWindowsCoveringUpto(63), is(Arrays.asList(1L, 2L, 4L, 8L, 16L, 32L))); }
@Override public List<Long> getWindowsCoveringUpto(long N) { if (N <= 0) return Collections.emptyList(); addWindowsPastMarker(N); List<Long> ret = new ArrayList<>(); long prevMarker = 0; for (long currMarker: windowStartMarkers) { if (currMarker == 0) continue; if (currMarker <= N) { ret.add(currMarker - prevMarker); p...
GenericWindowing implements Windowing { @Override public List<Long> getWindowsCoveringUpto(long N) { if (N <= 0) return Collections.emptyList(); addWindowsPastMarker(N); List<Long> ret = new ArrayList<>(); long prevMarker = 0; for (long currMarker: windowStartMarkers) { if (currMarker == 0) continue; if (currMarker <= ...
GenericWindowing implements Windowing { @Override public List<Long> getWindowsCoveringUpto(long N) { if (N <= 0) return Collections.emptyList(); addWindowsPastMarker(N); List<Long> ret = new ArrayList<>(); long prevMarker = 0; for (long currMarker: windowStartMarkers) { if (currMarker == 0) continue; if (currMarker <= ...
GenericWindowing implements Windowing { @Override public List<Long> getWindowsCoveringUpto(long N) { if (N <= 0) return Collections.emptyList(); addWindowsPastMarker(N); List<Long> ret = new ArrayList<>(); long prevMarker = 0; for (long currMarker: windowStartMarkers) { if (currMarker == 0) continue; if (currMarker <= ...
GenericWindowing implements Windowing { @Override public List<Long> getWindowsCoveringUpto(long N) { if (N <= 0) return Collections.emptyList(); addWindowsPastMarker(N); List<Long> ret = new ArrayList<>(); long prevMarker = 0; for (long currMarker: windowStartMarkers) { if (currMarker == 0) continue; if (currMarker <= ...
@Test public void worldFromConfValidName() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.WORLD_NAME, "test"); when(Bukkit.getWorld("test")).thenReturn(mock(World.class)); World w = WorldLoader.worldFromConfig(conf, false); Assert.assertNotNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf....
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
@Test public void blockLocationFromConfigValid() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, 6); conf.set(WorldLoader.Y, 0); conf.set(WorldLoader.Z, -4); conf.set(WorldLoader.WORLD_NAME, "test"); when(Bukkit.getWorld("test")).thenReturn(mock(World.class)); Location loc = WorldLoader.bloc...
@Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
@Test public void blockLocationFromConfigNoWorld() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, 6); conf.set(WorldLoader.Y, 0); conf.set(WorldLoader.Z, -4); Location loc = WorldLoader.blockLocationFromConfig(conf, false); Assert.assertNull(loc); }
@Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
@Test public void blockLocationFromConfigInvalidPos() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, 6); conf.set(WorldLoader.Y, "ye"); conf.set(WorldLoader.Z, -4); conf.set(WorldLoader.WORLD_NAME, "test"); when(Bukkit.getWorld("test")).thenReturn(mock(World.class)); Location loc = WorldLoa...
@Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); return loc; }
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
WorldLoader { @Nullable public static Location blockLocationFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { World world = worldFromConfig(conf, useUUID); if (world == null) { return null; } Location loc = worldlessBlockLocationFromConfig(conf); if (loc == null) { return null; } loc.setWorld(world); re...
@Test public void createDataFolderCreatesCorrectPath() throws IOException { File file = FileUtils.createDatafolderFile(plugin, "test.json"); assertTrue(file.exists()); assertTrue(file.isFile()); assertEquals(dataFolder.getRoot().getPath() + File.separator + "test.json", file.getPath()); }
@NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFil...
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFil...
@Test public void createDataFolderCreatesCorrectSubPath() throws IOException { File file = FileUtils.createDatafolderFile(plugin, "testii", "test.json"); assertTrue(file.exists()); assertTrue(file.isFile()); String pathExpected = dataFolder.getRoot().getPath() + File.separator + "testii" + File.separator + "test.json";...
@NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFil...
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFil...
@Test public void createDataFolderCreatesCorrectSubSubPath() throws IOException { File file = FileUtils.createDatafolderFile(plugin, "testii", "testii2", "test.json"); assertTrue(file.exists()); assertTrue(file.isFile()); String pathExpected = dataFolder.getRoot().getPath() + File.separator + "testii" + File.separator ...
@NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } }
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFil...
FileUtils { @NotNull public static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) throws IOException { File file = getDatafolderFile(plugin, children); createFileSafely(file); return file; } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFil...
@Test public void writeFailsWhenGivenFileIsFolder() throws IOException { assertFalse(FileUtils.write("whatever", plugin)); }
public static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path) throws IOException { return write(string, createDatafolderFile(plugin, path)); }
FileUtils { public static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path) throws IOException { return write(string, createDatafolderFile(plugin, path)); } }
FileUtils { public static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path) throws IOException { return write(string, createDatafolderFile(plugin, path)); } }
FileUtils { public static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path) throws IOException { return write(string, createDatafolderFile(plugin, path)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @No...
FileUtils { public static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path) throws IOException { return write(string, createDatafolderFile(plugin, path)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @No...
@Test public void getDatafolderFileDoesNotCreateAnything() { File file = FileUtils.getDatafolderFile(plugin, "notafile.txt"); assertFalse(file.exists()); }
@NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + joinPath(File...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
@Test(expected = IllegalArgumentException.class) public void getDatafolderFileWithNullElementReturnsNull() { FileUtils.getDatafolderFile(plugin, null, "notafile.txt"); }
@NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + joinPath(File...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
@Test(expected = IllegalArgumentException.class) public void getDatafolderFileWithNullElementReturnsNull2() { FileUtils.getDatafolderFile(plugin, "folder", null); }
@NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + joinPath(File...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
FileUtils { @NotNull public static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children) { try { return Paths.get(plugin.getDataFolder().getAbsolutePath(), children).toFile(); } catch (NullPointerException e) { throw new IllegalArgumentException( "One of the children given is null. children: " + j...
@Test public void worldFromConfValidUUID() { YamlConfiguration conf = new YamlConfiguration(); UUID uuid = UUID.randomUUID(); conf.set(WorldLoader.WORLD_UID, uuid.toString()); when(Bukkit.getWorld(uuid)).thenReturn(mock(World.class)); World w = WorldLoader.worldFromConfig(conf, true); Assert.assertNotNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf....
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
@Test public void getFilesReturnAllFilesInFolder() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 10; List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "file" + i); createdFiles.add(file); assertTrue(fi...
@Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); }
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } }
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } }
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); st...
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); st...
@Test public void getFilesInEmptyFolderReturnEmptyList() { List<File> files = FileUtils.getFiles(plugin); assertNotNull(files); assertTrue(files.isEmpty()); }
@Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); }
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } }
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } }
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); st...
FileUtils { @Nullable public static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath) { return getFiles(getDatafolderFile(plugin, subPath)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); st...
@Test public void getFileNamesIgnoresFolders() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 40; List<String> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "file" + i); if (random.nextBoolean()) { createdFile...
@Nullable public static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath) { List<File> files = getFiles(plugin, subPath); if (files == null) { return null; } return getFileNames(files); }
FileUtils { @Nullable public static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath) { List<File> files = getFiles(plugin, subPath); if (files == null) { return null; } return getFileNames(files); } }
FileUtils { @Nullable public static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath) { List<File> files = getFiles(plugin, subPath); if (files == null) { return null; } return getFileNames(files); } }
FileUtils { @Nullable public static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath) { List<File> files = getFiles(plugin, subPath); if (files == null) { return null; } return getFileNames(files); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafold...
FileUtils { @Nullable public static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath) { List<File> files = getFiles(plugin, subPath); if (files == null) { return null; } return getFileNames(files); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafold...
@Test public void getRecursiveFilesIsSameAsGetFilesWhenNoSubfolders() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 40; List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "recfile" + i); createdFiles.ad...
@NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
@Test public void getRecursiveFilesIgnoresFilesWithHyphenWhenTrue() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 40; List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "recfile" + i); createdFiles.add(...
@NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
@Test public void getRecursiveFilesIncludesFilesWithHyphenWhenFalse() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 40; List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "recfile" + i); createdFiles.ad...
@NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
@Test public void getRecursiveFilesIncludesFoldersWithHyphenWhenFalse() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 40; List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "recfile" + i); createdFiles....
@NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDa...
@Test public void getInternalFileStreamBinFileEquals() throws IOException { String s = "/" + String.join("/", TEST_BIN_FILE_WITH_DIR_PATH); InputStream isE = FileUtilsTest.class.getResourceAsStream(s); assertNotNull(isE); InputStream isA = FileUtils.getInternalFileStream(TEST_BIN_FILE_WITH_DIR_PATH); assertNotNull(isA)...
@Nullable public static InputStream getInternalFileStream(@NotNull String... absPath) { return getInternalFileStream(FileUtils.class, absPath); }
FileUtils { @Nullable public static InputStream getInternalFileStream(@NotNull String... absPath) { return getInternalFileStream(FileUtils.class, absPath); } }
FileUtils { @Nullable public static InputStream getInternalFileStream(@NotNull String... absPath) { return getInternalFileStream(FileUtils.class, absPath); } }
FileUtils { @Nullable public static InputStream getInternalFileStream(@NotNull String... absPath) { return getInternalFileStream(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static vo...
FileUtils { @Nullable public static InputStream getInternalFileStream(@NotNull String... absPath) { return getInternalFileStream(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static vo...
@Test public void readInternalFileReadsTestFileCorrectly() throws IOException { String s = "/" + String.join("/", TEST_FILE_WITH_DIR_PATH); InputStream is = FileUtilsTest.class.getResourceAsStream(s); assertNotNull(is); String fileContent = IOUtils.toString(is); assertEquals(fileContent, FileUtils.readInternalFile(TEST...
@Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSa...
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSa...
@Test public void readInternalFileReadsTestFileCorrectly2() throws IOException { String s = "/" + String.join("/", TEST_FILE_WITHOUT_DIR_PATH); InputStream is = FileUtilsTest.class.getResourceAsStream(s); assertNotNull(is); String fileContent = IOUtils.toString(is); assertEquals(fileContent, FileUtils.readInternalFile(...
@Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSa...
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSa...
@Test public void worldFromConfInValidName() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.WORLD_NAME, "aa"); World w = WorldLoader.worldFromConfig(conf, true); Assert.assertNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf....
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
@Test public void readInternalFileHandleNonExistingFileCorrectly() throws IOException { assertNull(FileUtils.readInternalFile("non-existing")); }
@Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } }
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSa...
FileUtils { @Nullable public static String readInternalFile(@NotNull String... absPath) { return readInternalFile(FileUtils.class, absPath); } static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSa...
@Test public void testCountOneEqualElement() { int amount = 16; ItemStack item = new ItemStack(Material.APPLE, amount); Inventory inv = mock(Inventory.class); when(inv.getContents()).thenReturn(new ItemStack[] {item}); Assert.assertEquals(amount, InventoryUtil.count(inv, item)); }
public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
@Test public void testCountNoItems() { Inventory inv = mock(Inventory.class); when(inv.getContents()).thenReturn(new ItemStack[] {}); Assert.assertEquals(0, InventoryUtil.count(inv, new ItemStack(Material.APPLE))); }
public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
@Test public void testCountDuplicate() { int amount = 16; ItemStack item = new ItemStack(Material.APPLE, amount); Inventory inv = mock(Inventory.class); when(inv.getContents()).thenReturn(new ItemStack[] {item, item}); Assert.assertEquals(2 * amount, InventoryUtil.count(inv, item)); }
public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
@Test public void testCountDuplicateNewInstance() { int amount = 16; ItemStack itemA = new ItemStack(Material.APPLE, amount); ItemStack itemB = new ItemStack(Material.APPLE, amount * 2); Inventory inv = mock(Inventory.class); when(inv.getContents()).thenReturn(new ItemStack[] {itemA, itemB}); assertTrue(itemA.isSimilar...
public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
@Test public void testCountOtherItems() { int amount = 16; ItemStack itemA = new ItemStack(Material.APPLE, amount); ItemStack itemB = new ItemStack(Material.GOLDEN_APPLE, amount / 2); Inventory inv = mock(Inventory.class); when(inv.getContents()).thenReturn(new ItemStack[] {itemA, itemB}); Assert.assertEquals(amount, I...
public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } }
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
InventoryUtil { public static int count(@NotNull Inventory inv, @NotNull ItemStack item) { int amount = 0; for (ItemStack invItem : inv.getContents()) { if (item.isSimilar(invItem)) { amount += invItem.getAmount(); } } return amount; } @SuppressWarnings("deprecation") static void removeInvItem(@NotNull final Inventory...
@Test(expected = FileNotFoundException.class) public void saveDefaultResourcesNotExistingWhenNotCreating() throws IOException { ConfigUtil.saveDefaultResources(plugin, false, NON_EXISTING_TEST_FILE_WITH_DIR_PATH); }
public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources); static void saveDefaultResources(@NotNull Plugin plugi...
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources); static void saveDefaultResources(@NotNull Plugin plugi...
@Test public void saveDefaultResourcesDoesNotOverwrite() throws IOException { String content = "yaegstfiuaeifyefgsaiefgipsaefåøæ"; FileUtils.write(content, plugin, TEST_FILE_WITH_DIR_PATH); ConfigUtil.saveDefaultResources(plugin, TEST_FILE_WITH_DIR_PATH); assertEquals(content, FileUtils.read(plugin, TEST_FILE_WITH_DIR_...
public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources); static void saveDefaultResources(@NotNull Plugin plugi...
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources); static void saveDefaultResources(@NotNull Plugin plugi...
@Test public void saveDefaultResourcesSavesMultipleFiles() throws IOException { String[] filesPaths = {TEST_FILE_WITH_DIR_PATH, TEST_FILE_WITHOUT_DIR_PATH, NON_EXISTING_TEST_FILE_WITH_DIR_PATH}; List<File> expectedFiles = new ArrayList<>(); for (String path : filesPaths) { expectedFiles.add(FileUtils.getDatafolderFile(...
public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } }
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources); static void saveDefaultResources(@NotNull Plugin plugi...
ConfigUtil { public static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources) throws IOException { saveDefaultResources(plugin, true, resources); } static void saveDefaultResources(@NotNull Plugin plugin, @NotNull String... resources); static void saveDefaultResources(@NotNull Plugin plugi...
@Test public void worldFromConfInValidUUID() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.WORLD_UID, UUID.randomUUID()); World w = WorldLoader.worldFromConfig(conf, true); Assert.assertNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf....
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
@Test public void worldFromConfNullName() { World w = WorldLoader.worldFromConfig(new YamlConfiguration(), false); Assert.assertNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf....
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
@Test public void worldFromConfNullUUID() { World w = WorldLoader.worldFromConfig(new YamlConfiguration(), true); Assert.assertNull(w); }
@Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String worldName = conf....
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
WorldLoader { @Nullable public static World worldFromConfig(@NotNull ConfigurationSection conf, boolean useUUID) { if (useUUID) { UUID worldUUID; try { worldUUID = UUID.fromString(conf.getString(WORLD_UID, "")); } catch (IllegalArgumentException e) { return null; } return Bukkit.getWorld(worldUUID); } else { String wor...
@Test public void worldlessBlockLocFromConfEmpty() { Location loc = WorldLoader.worldlessBlockLocationFromConfig(new YamlConfiguration()); Assert.assertNull(loc); }
@Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatException ex) { re...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
@Test public void worldlessBlockLocFromConfValid() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, 4); conf.set(WorldLoader.Y, 0); conf.set(WorldLoader.Z, -4); Location loc = WorldLoader.worldlessBlockLocationFromConfig(conf); Assert.assertNotNull(loc); }
@Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatException ex) { re...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
@Test public void worldlessBlockLocFromConfNotAllKeys() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, 4); conf.set(WorldLoader.Z, -4); Location loc = WorldLoader.worldlessBlockLocationFromConfig(conf); Assert.assertNull(loc); }
@Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatException ex) { re...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
@Test public void worldlessBlockLocFromConfWrongType() { YamlConfiguration conf = new YamlConfiguration(); conf.set(WorldLoader.X, "aaaaaa"); conf.set(WorldLoader.Y, 0); conf.set(WorldLoader.Z, -4); Location loc = WorldLoader.worldlessBlockLocationFromConfig(conf); Assert.assertNull(loc); }
@Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatException ex) { re...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
WorldLoader { @Nullable public static Location worldlessBlockLocationFromConfig(@NotNull ConfigurationSection conf) { try { int x = Integer.parseInt(conf.getString(X)); int y = Integer.parseInt(conf.getString(Y)); int z = Integer.parseInt(conf.getString(Z)); return new Location(null, x, y, z); } catch (NumberFormatExce...
@Test public void testShowDataOnResume() { mPresenter.onViewResumed(); verify(mView).showData(anyString()); }
@Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } MainPresenter(ITypedView<String, Throwable> view); }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } MainPresenter(ITypedView<String, Throwable> view); @Override void onViewResumed(); }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } MainPresenter(ITypedView<String, Throwable> view); @Override void onViewResumed(); }
@Test public void testShowErrorOnResume() { mPresenter.onViewResumed(); verify(mView).showError(any(Throwable.class)); }
@Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } MainPresenter(ITypedView<String, Throwable> view); }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } MainPresenter(ITypedView<String, Throwable> view); @Override void onViewResumed(); }
MainPresenter extends BaseTypedPresenter<String, Throwable> { @Override public void onViewResumed() { getView().showData("This is some awesome data"); getView().showError(new RuntimeException("Exceptional Error")); } MainPresenter(ITypedView<String, Throwable> view); @Override void onViewResumed(); }
@Test public void allCards() { Assert.assertEquals(this.jdkDeck.getCards(), this.ecDeck.getCards()); }
public ImmutableList<Card> getCards() { return this.cards; }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); }
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerH...
EclipseCollectionsDeckOfCardsAsList { public ImmutableList<Card> getCards() { return this.cards; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerH...
@Test public void forEachWithIndex() { MutableList<String> list = MutableList.empty(); this.testObj.withAll("1", "2", "3", "2", "3", "3") .forEachWithIndex((each, index) -> list.add(each + index)); Assert.assertEquals(MutableList.of("10", "21", "22", "33", "34", "35"), list); }
public void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer) { Counter index = new Counter(); this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { biConsumer.accept(key, index.getCount()); index.increment(); } }); }
HashBag implements MutableBag<T> { public void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer) { Counter index = new Counter(); this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { biConsumer.accept(key, index.getCount()); index.increment(); } }); } }
HashBag implements MutableBag<T> { public void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer) { Counter index = new Counter(); this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { biConsumer.accept(key, index.getCount()); index.increment(); } }); } }
HashBag implements MutableBag<T> { public void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer) { Counter index = new Counter(); this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { biConsumer.accept(key, index.getCount()); index.increment(); } }); } @Override int sizeDistinct(); @Ove...
HashBag implements MutableBag<T> { public void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer) { Counter index = new Counter(); this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { biConsumer.accept(key, index.getCount()); index.increment(); } }); } @Override int sizeDistinct(); @Ove...
@Test public void add() { this.testObj.add("1"); this.testObj.add("2"); this.testObj.add("2"); Assert.assertEquals(MutableBag.of("1", "2", "2"), this.testObj); }
@Override public boolean add(T element) { this.backingMap.merge(element, 1, (existingValue, newValue) -> existingValue + 1); this.size++; return true; }
HashBag implements MutableBag<T> { @Override public boolean add(T element) { this.backingMap.merge(element, 1, (existingValue, newValue) -> existingValue + 1); this.size++; return true; } }
HashBag implements MutableBag<T> { @Override public boolean add(T element) { this.backingMap.merge(element, 1, (existingValue, newValue) -> existingValue + 1); this.size++; return true; } }
HashBag implements MutableBag<T> { @Override public boolean add(T element) { this.backingMap.merge(element, 1, (existingValue, newValue) -> existingValue + 1); this.size++; return true; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Ob...
HashBag implements MutableBag<T> { @Override public boolean add(T element) { this.backingMap.merge(element, 1, (existingValue, newValue) -> existingValue + 1); this.size++; return true; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Ob...
@Test public void remove() { this.testObj.add("1"); this.testObj.add("2"); this.testObj.add("2"); Assert.assertEquals(MutableBag.of("1", "2", "2"), this.testObj); this.testObj.remove("2"); Assert.assertEquals(MutableBag.of("1"), this.testObj); this.testObj.remove("1"); Assert.assertEquals(MutableBag.empty(), this.testO...
@Override public boolean remove(Object o) { return this.removeOccurrences((T) o, Integer.MAX_VALUE); }
HashBag implements MutableBag<T> { @Override public boolean remove(Object o) { return this.removeOccurrences((T) o, Integer.MAX_VALUE); } }
HashBag implements MutableBag<T> { @Override public boolean remove(Object o) { return this.removeOccurrences((T) o, Integer.MAX_VALUE); } }
HashBag implements MutableBag<T> { @Override public boolean remove(Object o) { return this.removeOccurrences((T) o, Integer.MAX_VALUE); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer...
HashBag implements MutableBag<T> { @Override public boolean remove(Object o) { return this.removeOccurrences((T) o, Integer.MAX_VALUE); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer...
@Test public void containsAll() { Assert.assertTrue(this.testObj.containsAll(MutableList.empty())); Assert.assertFalse(this.testObj.containsAll(MutableList.of("1"))); this.testObj.withAll("1", "2", "3", "2", "3", "3"); Assert.assertTrue(this.testObj.containsAll(MutableList.of("1"))); Assert.assertTrue(this.testObj.cont...
@Override public boolean containsAll(Collection<?> c) { return c.stream().allMatch(each -> this.backingMap.containsKey(each)); }
HashBag implements MutableBag<T> { @Override public boolean containsAll(Collection<?> c) { return c.stream().allMatch(each -> this.backingMap.containsKey(each)); } }
HashBag implements MutableBag<T> { @Override public boolean containsAll(Collection<?> c) { return c.stream().allMatch(each -> this.backingMap.containsKey(each)); } }
HashBag implements MutableBag<T> { @Override public boolean containsAll(Collection<?> c) { return c.stream().allMatch(each -> this.backingMap.containsKey(each)); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void f...
HashBag implements MutableBag<T> { @Override public boolean containsAll(Collection<?> c) { return c.stream().allMatch(each -> this.backingMap.containsKey(each)); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void f...
@Test public void addAll() { Assert.assertFalse(this.testObj.addAll(MutableList.empty())); Assert.assertEquals(MutableBag.empty(), this.testObj); Assert.assertTrue(this.testObj.addAll(MutableList.of("1", "2", "2"))); Assert.assertEquals(MutableBag.of("1", "2", "2"), this.testObj); }
@Override public boolean addAll(Collection<? extends T> c) { int sizeBefore = this.size; c.forEach(each -> this.addOccurrence(each)); return sizeBefore != this.size; }
HashBag implements MutableBag<T> { @Override public boolean addAll(Collection<? extends T> c) { int sizeBefore = this.size; c.forEach(each -> this.addOccurrence(each)); return sizeBefore != this.size; } }
HashBag implements MutableBag<T> { @Override public boolean addAll(Collection<? extends T> c) { int sizeBefore = this.size; c.forEach(each -> this.addOccurrence(each)); return sizeBefore != this.size; } }
HashBag implements MutableBag<T> { @Override public boolean addAll(Collection<? extends T> c) { int sizeBefore = this.size; c.forEach(each -> this.addOccurrence(each)); return sizeBefore != this.size; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o...
HashBag implements MutableBag<T> { @Override public boolean addAll(Collection<? extends T> c) { int sizeBefore = this.size; c.forEach(each -> this.addOccurrence(each)); return sizeBefore != this.size; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o...
@Test public void removeAll() { Assert.assertFalse(this.testObj.removeAll(MutableList.empty())); this.testObj.withAll("1", "2", "3", "2", "3", "3"); Assert.assertTrue(this.testObj.removeAll(MutableList.of("1", "2"))); Assert.assertEquals(MutableBag.of("3", "3", "3"), this.testObj); Assert.assertFalse(this.testObj.remov...
@Override public boolean removeAll(Collection<?> c) { int sizeBefore = this.size; c.forEach(each -> this.removeOccurrences((T) each, Integer.MAX_VALUE)); return sizeBefore != this.size; }
HashBag implements MutableBag<T> { @Override public boolean removeAll(Collection<?> c) { int sizeBefore = this.size; c.forEach(each -> this.removeOccurrences((T) each, Integer.MAX_VALUE)); return sizeBefore != this.size; } }
HashBag implements MutableBag<T> { @Override public boolean removeAll(Collection<?> c) { int sizeBefore = this.size; c.forEach(each -> this.removeOccurrences((T) each, Integer.MAX_VALUE)); return sizeBefore != this.size; } }
HashBag implements MutableBag<T> { @Override public boolean removeAll(Collection<?> c) { int sizeBefore = this.size; c.forEach(each -> this.removeOccurrences((T) each, Integer.MAX_VALUE)); return sizeBefore != this.size; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boole...
HashBag implements MutableBag<T> { @Override public boolean removeAll(Collection<?> c) { int sizeBefore = this.size; c.forEach(each -> this.removeOccurrences((T) each, Integer.MAX_VALUE)); return sizeBefore != this.size; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boole...
@Test public void clear() { this.testObj.withAll("1", "2", "3", "2", "3", "3"); Assert.assertFalse(this.testObj.isEmpty()); this.testObj.clear(); Assert.assertTrue(this.testObj.isEmpty()); Assert.assertEquals(0, this.testObj.size()); Assert.assertEquals(0, this.testObj.sizeDistinct()); }
@Override public void clear() { this.backingMap.clear(); this.size = 0; }
HashBag implements MutableBag<T> { @Override public void clear() { this.backingMap.clear(); this.size = 0; } }
HashBag implements MutableBag<T> { @Override public void clear() { this.backingMap.clear(); this.size = 0; } }
HashBag implements MutableBag<T> { @Override public void clear() { this.backingMap.clear(); this.size = 0; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? super T, Integer> biConsum...
HashBag implements MutableBag<T> { @Override public void clear() { this.backingMap.clear(); this.size = 0; } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? super T, Integer> biConsum...
@Test public void getOccurrences() { this.testObj.withAll("1", "2", "3", "2", "3", "3"); Assert.assertEquals(1, this.testObj.getOccurrences("1")); Assert.assertEquals(2, this.testObj.getOccurrences("2")); Assert.assertEquals(3, this.testObj.getOccurrences("3")); Assert.assertEquals(0, this.testObj.getOccurrences("4"));...
@Override public int getOccurrences(T element) { return this.backingMap.getOrDefault(element, 0); }
HashBag implements MutableBag<T> { @Override public int getOccurrences(T element) { return this.backingMap.getOrDefault(element, 0); } }
HashBag implements MutableBag<T> { @Override public int getOccurrences(T element) { return this.backingMap.getOrDefault(element, 0); } }
HashBag implements MutableBag<T> { @Override public int getOccurrences(T element) { return this.backingMap.getOrDefault(element, 0); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? ...
HashBag implements MutableBag<T> { @Override public int getOccurrences(T element) { return this.backingMap.getOrDefault(element, 0); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? ...
@Test public void iterator() { this.testObj.withAll("1", "2", "3", "2", "3", "3"); Iterator<String> iterator = this.testObj.iterator(); Assert.assertEquals("1", iterator.next()); Assert.assertTrue(iterator.hasNext()); iterator.remove(); Assert.assertEquals("2", iterator.next()); iterator.remove(); Assert.assertEquals("...
@Override public Iterator<T> iterator() { return new BagIterator(); }
HashBag implements MutableBag<T> { @Override public Iterator<T> iterator() { return new BagIterator(); } }
HashBag implements MutableBag<T> { @Override public Iterator<T> iterator() { return new BagIterator(); } }
HashBag implements MutableBag<T> { @Override public Iterator<T> iterator() { return new BagIterator(); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer);...
HashBag implements MutableBag<T> { @Override public Iterator<T> iterator() { return new BagIterator(); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? super T, Integer> biConsumer);...
@Test public void addOccurrence() { this.testObj.addOccurrence("1"); Assert.assertEquals(MutableBag.of("1"), this.testObj); Assert.assertEquals(1, this.testObj.size()); Assert.assertEquals(1, this.testObj.sizeDistinct()); }
@Override public boolean addOccurrence(T element) { return this.addOccurrences(element, 1); }
HashBag implements MutableBag<T> { @Override public boolean addOccurrence(T element) { return this.addOccurrences(element, 1); } }
HashBag implements MutableBag<T> { @Override public boolean addOccurrence(T element) { return this.addOccurrences(element, 1); } }
HashBag implements MutableBag<T> { @Override public boolean addOccurrence(T element) { return this.addOccurrences(element, 1); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? super ...
HashBag implements MutableBag<T> { @Override public boolean addOccurrence(T element) { return this.addOccurrences(element, 1); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? super ...
@Test public void cardsBySuitIsImmutable() { var ecCardsBySuit = this.ecDeck.getCardsBySuit(); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCardsBySuit.get(Suit.CLUBS).castToList().remove(0)); Verify.assertThrows( UnsupportedOperationException.class, () -> ecCardsBySuit.get(Suit.CLUBS).castToList()...
public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; }
EclipseCollectionsDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } }
EclipseCollectionsDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsList(); }
EclipseCollectionsDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random...
EclipseCollectionsDeckOfCardsAsList { public ImmutableListMultimap<Suit, Card> getCardsBySuit() { return this.cardsBySuit; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random...
@Test public void addOccurrences() { this.testObj.addOccurrences("1", 1); Assert.assertEquals(MutableBag.of("1"), this.testObj); Assert.assertEquals(1, this.testObj.size()); Assert.assertEquals(1, this.testObj.sizeDistinct()); this.testObj.addOccurrences("2", 2); Assert.assertEquals(MutableBag.of("1", "2", "2"), this.t...
@Override public boolean addOccurrences(T element, int occurrences) { int sizeBefore = size; Integer merged = this.backingMap.merge(element, occurrences, (existingCount, e) -> existingCount + e); size = size + occurrences; return sizeBefore != size; }
HashBag implements MutableBag<T> { @Override public boolean addOccurrences(T element, int occurrences) { int sizeBefore = size; Integer merged = this.backingMap.merge(element, occurrences, (existingCount, e) -> existingCount + e); size = size + occurrences; return sizeBefore != size; } }
HashBag implements MutableBag<T> { @Override public boolean addOccurrences(T element, int occurrences) { int sizeBefore = size; Integer merged = this.backingMap.merge(element, occurrences, (existingCount, e) -> existingCount + e); size = size + occurrences; return sizeBefore != size; } }
HashBag implements MutableBag<T> { @Override public boolean addOccurrences(T element, int occurrences) { int sizeBefore = size; Integer merged = this.backingMap.merge(element, occurrences, (existingCount, e) -> existingCount + e); size = size + occurrences; return sizeBefore != size; } @Override int sizeDistinct(); @O...
HashBag implements MutableBag<T> { @Override public boolean addOccurrences(T element, int occurrences) { int sizeBefore = size; Integer merged = this.backingMap.merge(element, occurrences, (existingCount, e) -> existingCount + e); size = size + occurrences; return sizeBefore != size; } @Override int sizeDistinct(); @O...
@Test public void removeOccurrence() { Assert.assertFalse(this.testObj.removeOccurrence("1")); Assert.assertEquals(MutableBag.empty(), this.testObj); this.testObj.withAll("1", "2", "3", "2", "3", "3"); Assert.assertTrue(this.testObj.removeOccurrence("1")); Assert.assertEquals(MutableBag.of("2", "2", "3", "3", "3"), thi...
@Override public boolean removeOccurrence(T element) { return this.removeOccurrences(element, 1); }
HashBag implements MutableBag<T> { @Override public boolean removeOccurrence(T element) { return this.removeOccurrences(element, 1); } }
HashBag implements MutableBag<T> { @Override public boolean removeOccurrence(T element) { return this.removeOccurrences(element, 1); } }
HashBag implements MutableBag<T> { @Override public boolean removeOccurrence(T element) { return this.removeOccurrences(element, 1); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? ...
HashBag implements MutableBag<T> { @Override public boolean removeOccurrence(T element) { return this.removeOccurrences(element, 1); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void forEachWithIndex(BiConsumer<? ...
@Test public void removeOccurrences() { Assert.assertFalse(this.testObj.removeOccurrences("1", 1)); Assert.assertEquals(MutableBag.empty(), this.testObj); this.testObj.withAll("1", "2", "3", "2", "3", "3"); Assert.assertTrue(this.testObj.removeOccurrences("1", 2)); Assert.assertEquals(MutableBag.of("2", "2", "3", "3", ...
@Override public boolean removeOccurrences(T element, int occurrences) { int sizeBefore = size; Integer existing = this.backingMap.get(element); if (existing != null) { Integer newCount = existing - occurrences; if (newCount <= 0) { this.backingMap.remove(element); size = size - existing; } else { this.backingMap.put(e...
HashBag implements MutableBag<T> { @Override public boolean removeOccurrences(T element, int occurrences) { int sizeBefore = size; Integer existing = this.backingMap.get(element); if (existing != null) { Integer newCount = existing - occurrences; if (newCount <= 0) { this.backingMap.remove(element); size = size - exist...
HashBag implements MutableBag<T> { @Override public boolean removeOccurrences(T element, int occurrences) { int sizeBefore = size; Integer existing = this.backingMap.get(element); if (existing != null) { Integer newCount = existing - occurrences; if (newCount <= 0) { this.backingMap.remove(element); size = size - exist...
HashBag implements MutableBag<T> { @Override public boolean removeOccurrences(T element, int occurrences) { int sizeBefore = size; Integer existing = this.backingMap.get(element); if (existing != null) { Integer newCount = existing - occurrences; if (newCount <= 0) { this.backingMap.remove(element); size = size - exist...
HashBag implements MutableBag<T> { @Override public boolean removeOccurrences(T element, int occurrences) { int sizeBefore = size; Integer existing = this.backingMap.get(element); if (existing != null) { Integer newCount = existing - occurrences; if (newCount <= 0) { this.backingMap.remove(element); size = size - exist...
@Test public void forEachWithOccurrences() { MutableList<String> list = MutableList.empty(); this.testObj.withAll("1", "2", "3", "2", "3", "3") .forEachWithOccurrences((each, count) -> list.add(each + count)); Assert.assertEquals(MutableList.of("11", "22", "33"), list); }
@Override public void forEachWithOccurrences(BiConsumer<? super T, Integer> biConsumer) { this.backingMap.forEach(biConsumer); }
HashBag implements MutableBag<T> { @Override public void forEachWithOccurrences(BiConsumer<? super T, Integer> biConsumer) { this.backingMap.forEach(biConsumer); } }
HashBag implements MutableBag<T> { @Override public void forEachWithOccurrences(BiConsumer<? super T, Integer> biConsumer) { this.backingMap.forEach(biConsumer); } }
HashBag implements MutableBag<T> { @Override public void forEachWithOccurrences(BiConsumer<? super T, Integer> biConsumer) { this.backingMap.forEach(biConsumer); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void f...
HashBag implements MutableBag<T> { @Override public void forEachWithOccurrences(BiConsumer<? super T, Integer> biConsumer) { this.backingMap.forEach(biConsumer); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Object[] toArray(); void f...
@Test public void forEach() { MutableList<String> list = MutableList.empty(); this.testObj.withAll("1", "2", "3", "2", "3", "3") .forEach((each) -> list.add(each)); Assert.assertEquals(MutableList.of("1", "2", "2", "3", "3", "3"), list); }
@Override public void forEach(Consumer<? super T> consumer) { this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { consumer.accept(key); } }); }
HashBag implements MutableBag<T> { @Override public void forEach(Consumer<? super T> consumer) { this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { consumer.accept(key); } }); } }
HashBag implements MutableBag<T> { @Override public void forEach(Consumer<? super T> consumer) { this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { consumer.accept(key); } }); } }
HashBag implements MutableBag<T> { @Override public void forEach(Consumer<? super T> consumer) { this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { consumer.accept(key); } }); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o...
HashBag implements MutableBag<T> { @Override public void forEach(Consumer<? super T> consumer) { this.backingMap.forEach((key, count) -> { for (int i = 0; i < count; i++) { consumer.accept(key); } }); } @Override int sizeDistinct(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o...
@Test public void isEmpty() { this.testObj = new UnmodifiableArrayListMultimap(new ArrayListMultimap()); Assert.assertTrue(this.testObj.isEmpty()); this.testObj = new UnmodifiableArrayListMultimap(this.inputMultimap); Assert.assertFalse(this.testObj.isEmpty()); }
@Override public boolean isEmpty() { return this.BACKING_MULTIMAP.isEmpty(); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean isEmpty() { return this.BACKING_MULTIMAP.isEmpty(); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean isEmpty() { return this.BACKING_MULTIMAP.isEmpty(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean isEmpty() { return this.BACKING_MULTIMAP.isEmpty(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultimap<K, V> asUnmodifiable(); @...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean isEmpty() { return this.BACKING_MULTIMAP.isEmpty(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultimap<K, V> asUnmodifiable(); @...
@Test public void get() { MutableList<Integer> value = this.testObj.get("A"); Assert.assertEquals(MutableList.of(1, 2, 3, 1), value); Assert.assertEquals(MutableList.empty(), this.testObj.get("C")); Verify.assertThrows(UnsupportedOperationException.class, () -> value.add(6)); }
@Override public MutableList<V> get(Object key) { return this.BACKING_MULTIMAP.get(key).asUnmodifiable(); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> get(Object key) { return this.BACKING_MULTIMAP.get(key).asUnmodifiable(); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> get(Object key) { return this.BACKING_MULTIMAP.get(key).asUnmodifiable(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> get(Object key) { return this.BACKING_MULTIMAP.get(key).asUnmodifiable(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMulti...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> get(Object key) { return this.BACKING_MULTIMAP.get(key).asUnmodifiable(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMulti...
@Test public void put() { Verify.assertThrows(UnsupportedOperationException.class, () -> this.testObj.put("A", 1)); }
@Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayLi...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayLi...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayLi...
@Test public void get_putIterable() { Verify.assertThrows(UnsupportedOperationException.class, () -> this.testObj.put("A", MutableList.of(1))); }
@Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayLi...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayLi...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean put(K key, RichIterable<V> value) { throw new UnsupportedOperationException("Not allowed to perform put() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayLi...
@Test public void putAll() { Verify.assertThrows(UnsupportedOperationException.class, () -> this.testObj.putAll(MutableMap.of("A", MutableList.of(1, 2, 3)))); }
@Override public void putAll(Map<? extends K, ? extends RichIterable<V>> map) { throw new UnsupportedOperationException("Not allowed to perform putAll() on " + UnmodifiableArrayListMultimap.class); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void putAll(Map<? extends K, ? extends RichIterable<V>> map) { throw new UnsupportedOperationException("Not allowed to perform putAll() on " + UnmodifiableArrayListMultimap.class);...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void putAll(Map<? extends K, ? extends RichIterable<V>> map) { throw new UnsupportedOperationException("Not allowed to perform putAll() on " + UnmodifiableArrayListMultimap.class);...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void putAll(Map<? extends K, ? extends RichIterable<V>> map) { throw new UnsupportedOperationException("Not allowed to perform putAll() on " + UnmodifiableArrayListMultimap.class);...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void putAll(Map<? extends K, ? extends RichIterable<V>> map) { throw new UnsupportedOperationException("Not allowed to perform putAll() on " + UnmodifiableArrayListMultimap.class);...
@Test public void countsBySuit() { Assert.assertEquals( this.jdkDeck.countsBySuit().get(Suit.CLUBS).intValue(), this.ecDeck.countsBySuit().occurrencesOf(Suit.CLUBS)); }
public Bag<Suit> countsBySuit() { return null; }
EclipseCollectionsDeckOfCardsAsList { public Bag<Suit> countsBySuit() { return null; } }
EclipseCollectionsDeckOfCardsAsList { public Bag<Suit> countsBySuit() { return null; } EclipseCollectionsDeckOfCardsAsList(); }
EclipseCollectionsDeckOfCardsAsList { public Bag<Suit> countsBySuit() { return null; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); Immuta...
EclipseCollectionsDeckOfCardsAsList { public Bag<Suit> countsBySuit() { return null; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); Immuta...
@Test public void remove() { Verify.assertThrows(UnsupportedOperationException.class, () -> this.testObj.remove("A")); }
@Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMul...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMul...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMul...
@Test public void remove_keyValue() { Verify.assertThrows(UnsupportedOperationException.class, () -> this.testObj.remove("A")); }
@Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMul...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMul...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public MutableList<V> remove(Object key) { throw new UnsupportedOperationException("Not allowed to perform remove() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMul...
@Test public void containsKey() { Assert.assertTrue(this.testObj.containsKey("A")); Assert.assertTrue(this.testObj.containsKey("B")); Assert.assertFalse(this.testObj.containsKey("C")); }
@Override public boolean containsKey(Object key) { return this.BACKING_MULTIMAP.containsKey(key); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsKey(Object key) { return this.BACKING_MULTIMAP.containsKey(key); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsKey(Object key) { return this.BACKING_MULTIMAP.containsKey(key); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsKey(Object key) { return this.BACKING_MULTIMAP.containsKey(key); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultimap<K, V...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsKey(Object key) { return this.BACKING_MULTIMAP.containsKey(key); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultimap<K, V...
@Test public void containsValue() { Assert.assertTrue(this.testObj.containsValue(1)); Assert.assertTrue(this.testObj.containsValue(2)); Assert.assertTrue(this.testObj.containsValue(3)); Assert.assertTrue(this.testObj.containsValue(10)); Assert.assertFalse(this.testObj.containsValue(4)); }
@Override public boolean containsValue(Object value) { return this.BACKING_MULTIMAP.containsValue(value); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsValue(Object value) { return this.BACKING_MULTIMAP.containsValue(value); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsValue(Object value) { return this.BACKING_MULTIMAP.containsValue(value); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsValue(Object value) { return this.BACKING_MULTIMAP.containsValue(value); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMulti...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public boolean containsValue(Object value) { return this.BACKING_MULTIMAP.containsValue(value); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMulti...
@Test public void clear() { Verify.assertThrows(UnsupportedOperationException.class, () -> this.testObj.clear()); }
@Override public void clear() { throw new UnsupportedOperationException("Not allowed to perform clear() on " + UnmodifiableArrayListMultimap.class); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void clear() { throw new UnsupportedOperationException("Not allowed to perform clear() on " + UnmodifiableArrayListMultimap.class); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void clear() { throw new UnsupportedOperationException("Not allowed to perform clear() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMultimap(MutableMultimap<...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void clear() { throw new UnsupportedOperationException("Not allowed to perform clear() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMultimap(MutableMultimap<...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void clear() { throw new UnsupportedOperationException("Not allowed to perform clear() on " + UnmodifiableArrayListMultimap.class); } UnmodifiableArrayListMultimap(MutableMultimap<...
@Test public void keySet() { Assert.assertEquals(MutableSet.of("A", "B"), this.testObj.keySet()); }
@Override public Set<K> keySet() { return this.BACKING_MULTIMAP.keySet(); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public Set<K> keySet() { return this.BACKING_MULTIMAP.keySet(); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public Set<K> keySet() { return this.BACKING_MULTIMAP.keySet(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public Set<K> keySet() { return this.BACKING_MULTIMAP.keySet(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultimap<K, V> asUnmodifiable(); @Ove...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public Set<K> keySet() { return this.BACKING_MULTIMAP.keySet(); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultimap<K, V> asUnmodifiable(); @Ove...
@Test public void forEach() { MutableList<String> combined = MutableList.empty(); this.testObj.forEach((key, value) -> combined.add(key + value.toString())); Assert.assertEquals( MutableList.of("A1", "A2", "A3", "A1", "B10", "B10"), combined); }
@Override public void forEach(BiConsumer<K, V> biConsumer) { this.BACKING_MULTIMAP.forEach(biConsumer); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void forEach(BiConsumer<K, V> biConsumer) { this.BACKING_MULTIMAP.forEach(biConsumer); } }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void forEach(BiConsumer<K, V> biConsumer) { this.BACKING_MULTIMAP.forEach(biConsumer); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); }
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void forEach(BiConsumer<K, V> biConsumer) { this.BACKING_MULTIMAP.forEach(biConsumer); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultima...
UnmodifiableArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public void forEach(BiConsumer<K, V> biConsumer) { this.BACKING_MULTIMAP.forEach(biConsumer); } UnmodifiableArrayListMultimap(MutableMultimap<K, V> multimap); @Override MutableListMultima...
@Test public void get_put() { this.testObj.put("A", 1); Assert.assertEquals(MutableList.of(1), this.testObj.get("A")); Assert.assertEquals(1, this.testObj.size()); this.testObj.put("A", 2); Assert.assertEquals(MutableList.of(1, 2), this.testObj.get("A")); Assert.assertEquals(2, this.testObj.size()); this.testObj.put("A...
@Override public int size() { return this.size; }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
@Test public void get_putIterable() { this.testObj.put("A", MutableList.of(1)); Assert.assertEquals(MutableList.of(1), this.testObj.get("A")); Assert.assertEquals(1, this.testObj.size()); this.testObj.put("A", MutableList.of(2, 1)); Assert.assertEquals(MutableList.of(1, 2, 1), this.testObj.get("A")); Assert.assertEqual...
@Override public int size() { return this.size; }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
@Test public void putAll() { this.testObj.putAll(MutableMap.of("A", MutableList.of(1, 2, 3))); Assert.assertEquals(MutableList.of(1, 2, 3), this.testObj.get("A")); Assert.assertEquals(3, this.testObj.size()); this.testObj.putAll(MutableMap.of("B", MutableList.of(10, 10))); Assert.assertEquals(MutableList.of(10, 10), th...
@Override public int size() { return this.size; }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
@Test public void countsByRank() { Assert.assertEquals( this.jdkDeck.countsByRank().get(Rank.TEN).intValue(), this.ecDeck.countsByRank().occurrencesOf(Rank.SEVEN)); }
public Bag<Rank> countsByRank() { return null; }
EclipseCollectionsDeckOfCardsAsList { public Bag<Rank> countsByRank() { return null; } }
EclipseCollectionsDeckOfCardsAsList { public Bag<Rank> countsByRank() { return null; } EclipseCollectionsDeckOfCardsAsList(); }
EclipseCollectionsDeckOfCardsAsList { public Bag<Rank> countsByRank() { return null; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); Immuta...
EclipseCollectionsDeckOfCardsAsList { public Bag<Rank> countsByRank() { return null; } EclipseCollectionsDeckOfCardsAsList(); MutableStack<Card> shuffle(Random random); MutableSet<Card> deal(MutableStack<Card> stack, int count); ImmutableList<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); Immuta...
@Test public void remove() { Assert.assertEquals(MutableList.empty(), this.testObj.remove("A")); this.testObj.putAll(MutableMap.of("A", MutableList.of(1, 2, 3))); this.testObj.putAll(MutableMap.of("B", MutableList.of(10, 10))); Assert.assertEquals(5, this.testObj.size()); this.testObj.remove("A"); Assert.assertEquals(2...
@Override public int size() { return this.size; }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
@Test public void remove_keyValue() { Assert.assertEquals(MutableList.empty(), this.testObj.remove("A")); this.testObj.putAll(MutableMap.of("A", MutableList.of(1, 2, 3, 1))); this.testObj.putAll(MutableMap.of("B", MutableList.of(10, 10))); Assert.assertEquals(6, this.testObj.size()); this.testObj.remove("A", 1); Assert...
@Override public int size() { return this.size; }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
@Test public void clear() { Assert.assertEquals(0, this.testObj.size()); this.testObj.clear(); this.testObj.putAll(MutableMap.of("A", MutableList.of(1, 2, 3, 1))); this.testObj.putAll(MutableMap.of("B", MutableList.of(10, 10))); Assert.assertEquals(6, this.testObj.size()); this.testObj.clear(); Assert.assertEquals(0, t...
@Override public int size() { return this.size; }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { @Override public int size() { return this.size; } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable(); }
@Test public void hashCodeEquals() { this.testObj.putAll(MutableMap.of("A", MutableList.of(1, 2, 3, 1))); this.testObj.putAll(MutableMap.of("B", MutableList.of(10, 10))); ArrayListMultimap<String, Integer> other = ArrayListMultimap.newMultimap(); other.putAll(MutableMap.of("A", MutableList.of(1, 2, 3, 1))); Assert.asse...
public static <K, V> ArrayListMultimap<K, V> newMultimap() { return new ArrayListMultimap<>(); }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { public static <K, V> ArrayListMultimap<K, V> newMultimap() { return new ArrayListMultimap<>(); } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { public static <K, V> ArrayListMultimap<K, V> newMultimap() { return new ArrayListMultimap<>(); } }
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { public static <K, V> ArrayListMultimap<K, V> newMultimap() { return new ArrayListMultimap<>(); } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable();...
ArrayListMultimap extends AbstractMutableMultimap<K, V, MutableList<V>> implements MutableListMultimap<K, V> { public static <K, V> ArrayListMultimap<K, V> newMultimap() { return new ArrayListMultimap<>(); } static ArrayListMultimap<K, V> newMultimap(); @Override int size(); MutableListMultimap<K, V> asUnmodifiable();...
@Test public void allCards() { Assert.assertEquals(this.jdk1Deck.getCards(), this.jdk2Deck.getCards()); }
public SortedSet<Card> getCards() { return this.cards; }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<C...
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<C...
@Test public void cardsAreImmutable() { var jdk2Cards = this.jdk2Deck.getCards(); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2Cards.remove(null)); Verify.assertThrows( UnsupportedOperationException.class, jdk2Cards::clear); Verify.assertThrows( UnsupportedOperationException.class, () -> jdk2Card...
public SortedSet<Card> getCards() { return this.cards; }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<C...
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> getCards() { return this.cards; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<C...
@Test public void diamonds() { Assert.assertEquals(this.jdk1Deck.diamonds(), this.jdk2Deck.diamonds()); }
public SortedSet<Card> diamonds() { return null; }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> s...
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> diamonds() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> s...
@Test public void hearts() { Assert.assertEquals(this.jdk1Deck.hearts(), this.jdk2Deck.hearts()); }
public SortedSet<Card> hearts() { return null; }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> shu...
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> hearts() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> shu...
@Test public void spades() { Assert.assertEquals(this.jdk1Deck.spades(), this.jdk2Deck.spades()); }
public SortedSet<Card> spades() { return null; }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> shu...
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> spades() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> shu...
@Test public void clubs() { Assert.assertEquals(this.jdk1Deck.clubs(), this.jdk2Deck.clubs()); }
public SortedSet<Card> clubs() { return null; }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } JDK8DeckOfCardsAsSortedSet(); }
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> shuf...
JDK8DeckOfCardsAsSortedSet { public SortedSet<Card> clubs() { return null; } JDK8DeckOfCardsAsSortedSet(); Deque<Card> shuffle(Random random); Set<Card> deal(Deque<Card> deque, int count); List<Set<Card>> shuffleAndDeal(Random random, int hands, int cardsPerHand); List<Set<Card>> dealHands( Deque<Card> shuf...