All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.samples.java.ex.LUI_Sample Maven / Gradle / Ivy

Go to download

An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.

There is a newer version: 7.6.8
Show newest version
package ex;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class LUI_Sample {

    public List testUseSingleton() {
        return Arrays.asList("foo");
    }

    public Set testAddVsAddAll(String one) {
        Set s = new HashSet<>();
        if ("foo".equals(one)) {
            s.addAll(Collections.singletonList(one));
        } else {
            s.addAll(Arrays.asList(one));
        }

        return s;
    }

    public String streamForGet0(List s) {
        return s.stream().findFirst().get();
    }

    public List fpWithArray() {
        return Arrays.asList("foo", "bar");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy