### Question:
BeaconUtil { public static int calculateRssi(float distance, float calibratedRssi, int calibratedDistance, float pathLossParameter) { return calculateRssi(distance, BeaconDistanceCalculator.getCalibratedRssiAtOneMeter(calibratedRssi, calibratedDistance), pathLossParameter); }  static float getAdvertisingRange(int transmissionPower); static double getSmallestDistance(List<? extends Beacon> beaconList); static double getSmallestDistance(List<? extends Beacon> beaconList, WindowFilter filter); static Beacon getClosestBeacon(List<? extends Beacon> beaconList); static Beacon getClosestBeacon(List<? extends Beacon> beaconList, WindowFilter filter); static int calculateRssiForDistance(Beacon beacon, float distance); static int calculateRssi(float distance, float calibratedRssi, int calibratedDistance, float pathLossParameter); static int calculateRssi(float distance, float calibratedRssi, float pathLossParameter); static float getAdvertisingRange(int transmissionPower, int calibratedTransmissionPower, int calibratedRange); static String getReadableBeaconType(AdvertisingPacket advertisingPacket); static String getReadableBeaconType(Class<? extends Beacon> beaconClass); static Comparator<Beacon> DescendingRssiComparator; static Comparator<Beacon> AscendingRssiComparator; }### Answer:
@Test public void calculateRssi_distanceSmallerOne_returnsRssiGreaterThanCalibrated() { float calibratedRssi = -35; float actualRssi = BeaconUtil.calculateRssi(0.5F, -35, 2F); assertTrue(calibratedRssi < actualRssi); }
@Test public void calculateRssi_distanceGreaterOne_returnsRssiSmallerThanCalibrated() { float calibratedRssi = -35; float actualRssi = BeaconUtil.calculateRssi(10, -35, 2F); assertTrue(calibratedRssi > actualRssi); }
@Test public void calculateRssi_distanceEqualOne_returnsRssiEqualThanCalibrated() { float calibratedRssi = -35; float actualRssi = BeaconUtil.calculateRssi(1, -35, 2F); assertEquals(calibratedRssi, actualRssi, 0.1); }
@Test public void calculateRssi_negativeDistance_throwsException() { exception.expect(IllegalArgumentException.class); BeaconUtil.calculateRssi(-1, -35, 2F); }