Code example for HashSet

0
@SuppressWarnings({"UnusedDeclaration"}) 
@Implements(BluetoothAdapter.class)
public class ShadowBluetoothAdapter { 
    private static final int ADDRESS_LENGTH = 17;
 
    private Set<BluetoothDevice> bondedDevices = new HashSet<BluetoothDevice>();
    private boolean isDiscovering;
    private String address;
    private boolean enabled;
    private int state;
 
    @Implementation 
    public static BluetoothAdapter getDefaultAdapter() {
        return (BluetoothAdapter) shadowOf(Robolectric.application).getBluetoothAdapter();
    } 
 
    @Implementation 
    public Set<BluetoothDevice> getBondedDevices() {
        return Collections.unmodifiableSet(bondedDevices);
    }