def METHOD_NAME() -> None:
    """Test that function works correctly."""
    # Prepare
    instances = [
        Instance(name="server", group="server", num_cpu=2, num_ram=4),
        Instance(name="client_0", group="clients", num_cpu=2, num_ram=8),
        Instance(name="logserver", group="logserver", num_cpu=2, num_ram=4),
        Instance(name="client_1", group="clients", num_cpu=2, num_ram=8),
    ]
    expected_groups = [[instances[0], instances[2]], [instances[1], instances[3]]]
    # Execute
    groups = group_instances_by_specs(instances)
    # Assert
    assert len(groups) == 2
    assert groups == expected_groups