### Question:
StackScalabilityCondition { boolean isScalable(Stack stack, String instanceGroupName) { InstanceGroup instanceGroup = getInstanceGroupByName(stack, instanceGroupName); List<InstanceStatus> statuses = getStatuses(instanceGroup); return statuses.stream().noneMatch(status -> status.equals(InstanceStatus.REQUESTED)); }    }### Answer:
@Test public void testIsScalableShouldReturnFalseWhenThereArePendingInstances() { Set<InstanceMetaData> instanceMetaData = createInstanceMetadataWithPendingInstance(); Stack stack = createStac(instanceMetaData); boolean actual = underTest.isScalable(stack, GROUP_NAME); assertFalse(actual); }
@Test public void testIsScalableShouldReturnTrueWhenThereAreNoPendingInstances() { Set<InstanceMetaData> instanceMetaData = createInstanceMetadataWithRegisteredInstances(); Stack stack = createStac(instanceMetaData); boolean actual = underTest.isScalable(stack, GROUP_NAME); assertTrue(actual); }